英文小辭典

把題目常出現單字放在這

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 顛倒

Last updated

Was this helpful?