290. Word Pattern
給定一個模式字串 pattern 和一個句子字串 s,請判斷 s 是否遵循 pattern 給定的模式。
題目條件:patt...
動態規劃(Dynamic programming),將複雜的問題分解成較為簡單的子問題來處理,在處理子問題的過程中可以尋找其中的規律,並將每一次的結果都進行計算...
Problem :
You are given an n x n 2D matrix representing an image, rotate the ima...
You are given an array nums consisting of positive integers.
Starting with score...
題目:給定一個非負整數 n,對於每個 0 ≤ i ≤ n 的整數 i,計算其二進位表示中 1 的個數,並回傳一個長度為 n+1 的陣列 ans,其中 ans[i...
這題要我生成所有合理的括號組合,就是要考我 遞迴(backtracking) 的能力,我要先知道題目要我尬麻?我需要先生成 n 對括號的所有合法組合,合法括號組...