📂
LeetCode Note
  • Introduction
  • Tools
    • Clean Code
    • 英文小辭典
    • JS Reference
    • 常見 Edge Case
    • Array Method
    • Object Method
    • Function
    • Hashing
    • Prototype
    • 處理 Array 小撇步
    • String Method
    • Math / Date
    • loop
    • JSON.xx / localStorage
    • Date
    • Regex
    • Memorization
    • reduce condition
    • 命名
  • 筆記 Note
    • Promise
    • Walking the DOM
    • Element size and scrolling
    • CSS
  • Leetcode todo
    • ToDo
  • Array
    • # Select random poker without duplicates
    • # 最少替換達成不連續字串
    • # 724 Find Pivot Index
    • # 747. Largest Number At Least Twice of Others
    • # 01 getMaxProfit
    • # maxOfBiggestVal
    • # findSecondLargest
    • # 41 First Missing Positive
    • # 134 Gas Station (有圖)
    • # 202 Happy Number
    • # 344 Reverse String
    • # 412 Fizz Buzz
    • # 561 Array Partition I
    • # 804 Unique Morse Code Words
    • # 905 Sort Array By Parity
    • # 121. Best Time to Buy and Sell Stock.js
    • # 122 Best Time to Buy and Sell Stock II
    • # 189 Rotate Array
    • # 229 Majority Element II
    • # 268 Missing Number.
    • # 299 Bulls and Cows (有圖)
    • # 896 Monotonic Array
    • # 1002 Find Common Characters
    • # 1051 Height Checker
    • # 1185 Day of the Week
    • # 169 Majority Element
    • # 605. Can Place Flowers
    • # 350 Intersection of Two Arrays II (有圖)
    • # 482. License Key Formatting
  • Set / Map
    • # GetLengthOfLongestSubstring
    • #1 Two Sum
    • # 217 Contains Duplicate
    • # 1122 Relative Sort Array
    • # 1160 Find Words That Can Be Formed by Characters
    • #811 Subdomain Visit Count
    • # 349 Intersection of Two Arrays
    • # 819 Most Common Word
  • Two Pointer
    • #704. Binary Search
    • #26 Remove Duplicates from Sorted Array (有圖)
    • #27 Remove Element
    • # 66 Plus One
    • # 80 Remove Duplicates from Sorted Array II (有圖)
    • # 88 Merge Sorted Array (有圖)
    • # 125 Valid Palindrome
    • #167 Two Sum II - Input array is sorted (有圖)
    • # 283 Move Zeroes (有圖)
    • # 38 Count and Say
    • # 557. Reverse Words in a String III
    • #977 Squares of a Sorted Array
    • #209 Minimum Size Subarray Sum
  • String
    • # 13 Roman to Integer (有圖)
    • # 771 Jewels and Stones
    • # 937 Reorder Data in Log Files
    • # 929 Unique Email Addresses
    • # 1108 Defanging an IP Address
    • #14 Longest Common Prefix
    • # 387 First Unique Character in a String (有圖)
    • #193 Valid Phone Numbers
    • # 28 Implement strStr()
    • #383 Ransom Note
  • Stack
    • # 20 Valid Parentheses (有圖)
    • # 155 Min Stack
    • BF 165. remove characters
    • #1047 Remove All Adjacent Duplicates In String
  • Binary Search
    • # 1064 Fixed Point (有圖)
    • # 852 Peak Index in a Mountain Array
  • Recursion 遞迴
    • #2625. Flatten Deeply Nested Array
  • Math
    • # 7 Reverse Integer
    • # 9 Palindrome Number (有圖)
    • #53 Maximum Subarray (有圖)
    • # 1085 Sum of Digits in the Minimum Number.
    • # 136 Single Number
    • # 204 Count Primes (有圖)
    • #243 Shortest Word Distance
  • Dynamic Programing
    • # 322 Coin Change
    • # 509 Fibonacci Number (有圖)
    • # 70 Climbing Stairs
    • # 198 House Robber
    • # 168. Excel Sheet Column Title
  • Others
    • # 205. Isomorphic Strings
    • Implement js Array method
    • Flatten Array/Object
  • Matrix
    • 867. Transpose Matrix
  • Queue
    • DOM tree with queue
  • 排序
    • Different Sort
Powered by GitBook
On this page
  • Array/String
  • Math Symbols
  • a
  • c
  • d
  • e
  • f
  • i
  • l
  • m
  • n
  • p
  • r
  • s

Was this helpful?

  1. Tools

英文小辭典

把題目常出現單字放在這

PreviousClean CodeNextJS Reference

Last updated 8 months ago

Was this helpful?

Array/String

  • Subarrays/substrings: 一定要連續的

 [1, 2, 3, 4] 
 // subarray 為
 [1], [1,2], [1,2,3], [1,2,3,4], [2,3,4], [3,4], [4] 等等
  • Subsequences: 排序要一樣但不一定是連續

 [1, 2, 3, 4] 
 // Subsequences 為
 [1, 3], [4], [], [2, 3], but not [3, 2], [5], [4, 1]
  • Subsets: any set of elements from the original array or string. 不管排序也不需要連續

 [1, 2, 3, 4] 
 // Subsets 為
 [3, 2], [4, 1, 2], [1]... 
 // subset 不管順序所以 [4, 1, 2] 跟 [1, 2, 4] 相同

Math Symbols

  • {} curly bracket

  • () round bracket

  • [] square bracket

  • ! Exclamation mark

a

  • ascending order 小到大

  • adjacent 相鄰

c

  • corresponding 相對應 ex. Given a date, return the corresponding day of the week for that date.

  • case sensitive 區分大小寫 ex. "a" is considered a different type of stone from "A"

  • contiguous / consecutively 連續的

  • composite number 複合數 (4, 6, 8, 9, 12...)

  • cube 三次方 , eg, 5³ (five cube), 那 n 次方為 5 to the power of n. (5ⁿ)

d

  • descending 大到小

  • divide 除

  • distinct 不同

  • denoted 表示, eg. commonly denoted F(n) form a sequence

  • Destructuring

let [a, b] = [1, 2];
[a, b] = [b, a]
// a =  2, b =1

e

  • even 偶數 / odd 奇數 distinct 不同 [範例]

  • encryption 加密

  • Expression : 會回傳東西

var a = 5;
12+ 3

f

  • followed by 其次是,eg. call '50", followed by a space, followed by the address. → 50 leetcode.com

i

  • integers 整數 = 正整數 + 附整數 + 零的統稱

  • indices 指數,ex. 位置 ['apple', 'banana'] apple 的 indices 就是 0

  • intersection 交集

  • Immutable 不可改變的, eg. 原始值 Number, String...

l

  • literals

[1, 2, 3] // Array literals  
2 // Numeric literals
{a: 1} //Object literals
"hannah" // String literals
`Hi ${dd}`  // Template literals

m

  • multiplication 乘

  • majority element 大多數的元素 ex. [2, 2, 2, 1] → 2

  • Mutable 可改變的, eg. obj

n

  • non-negative integers 正整數

p

  • positive integers 正整數

  • palindrome 回文

  • partition 分割

  • Primes Number 質數 (2, 3, 5, 7, 11...)

r

  • respectively 分別

  • Rest Parameters 可以把他想成取代 arguments 的語法

function sum(...nums) {
 console.log(nums)
}
sum(1, 2, 3, 4) // [1, 2, 3]

s

  • squares of its digits 數字平方, ex 9² → 81, 5²(five square)

  • Spread Operator 把陣列展開成個別值

var params = [ "a", 1, 7 ]
var other = [ 1, 2, ...params ] // [ 1, 2, "a", 1, 7 ]
  • Statement 不會回傳東西

if(){}
for(){}
while(){}

t

  • Ternary indicate 三元運算式,conditional ? truethy_block : falsey_block

  • Transpose 顛倒