Classic

138. Copy List with Random Pointer

138. Copy List with Random Pointer 這一題更能顯現為什麼 Hash Table 是一個非常好用的查找工具,

259. 3Sum Smaller

259. 3Sum Smaller class Solution: def threeSumSmaller(self, nums: List[

15. 3Sum

15. 3 Sum # target: 0 # [-1, -1, 2, -1] # -&

170. Two Sum III - Data structure design

170. Two Sum III - Data structure design 在 2

937. Reorder Data in Log Files

937. Reorder Data in Log Files 自定義排序 1. 如果第一個字是文字,有比較高的優先級,

490. The Maze

490. The Maze 這一個題目可以使用廣度優先搜索來解,這一個題目的困難是在於要如何理解球的運動方向。 一般而言廣度優先搜索的探索步伐是一部,可是這個題目裡面,球會滾到撞牆為止,所以當我在座標 (row,

732. My Calendar III

732. My Calendar III 題目在考 253. Meeting Rooms II 。 class

1490. Clone N-ary Tree

1490. Clone N-ary Tree 這個題目是樹,題目要考察是否可以寫出遍歷整棵樹的程式碼,類似的題目是 133. Clone Graph

309. Best Time to Buy and Sell Stock with Cool down

309. Best Time to Buy and Sell Stock with Cool

1. 2 Sum

1. 2 Sum Two sum 最簡單的就是用窮舉法把所有的組合都列出來,時間複雜度為 \(O(n^2)