Gary Lai

153. Find Minimum in Rotated Sorted Array

153. Find Minimum in Rotated Sorted Array 這個題目存在時間複雜度為線性的解法,那就是不管陣列有沒有排序,線性掃描整個陣列後,

81. Search in Rotated Sorted Array II

81. Search in Rotated Sorted Array II class Solution: def

33. Search in Rotated Sorted Array

33. Search in Rotated Sorted Array 1. 中間的值和目標相同:答案 2.

247. Strobogrammatic Number II

247. Strobogrammatic Number II 根據 Leetcode 的資料,這一題是 Google 常見的考題,

1219. Path with Maximum Gold

1219. Path with Maximum Gold class Solution: def getMaximumGold(self,

425. Word Squares

425. Word Squares class Solution: def wordSquares(self, words: List[

212. Word Search II

212. Word Search II 這一題是 79. Word Search 的進階版,原先我們要找的是給定一個字串,

79. Word Search

79. Word Search 這一題用的是回溯算法,接著從矩陣的每個字元開始出發,首先會先判斷兩件事情: 1. 是否超過邊界? 2. 該座標的是不是目標字串的第一個字?

17. Letter Combinations of a Phone Number

17. Letter Combinations of a Phone Number 這是一題看起來很嚇人的考題,不過最花時間的地方是寫出每個按鍵與其對應的字元。 窮舉的方式就是窮舉出每個按鈕有的字元,

489. Robot Room Cleaner

489. Robot Room Cleaner # """ # This is the