原创 【亞馬遜】Amazon內推,24小時回覆【幫解答和提供建議】

【亞馬遜】Amazon內推,24小時回覆【幫解答和提供建議】 上岸後提供內推,我自己是刷了LC500題以及其他地方收集的面經若干題,並且幫助其他同學們面過一些公司所以還是有挺多經驗可以幫忙解惑。 可以回答各種亞麻的問題,也可以提

原创 leetcode刷題筆記-回溯 Backtrace

140. Word Break II class Solution(object): def wordBreak(self, s, wordDict): return self.helper(s, wordDi

原创 leetcode刷題整理-用java做的題

JAVA一些語法整理: Queue: Queue<String> queue = new LinkedList<String>(); queue.offer("a"); // 添加一個元素並返回true queue.poll();

原创 leetcode刷題筆記-substring題

76. Minimum Window Substring  有模板的題!https://leetcode.com/problems/minimum-window-substring/discuss/26808/Here-is-a-10-l

原创 leetcode刷題筆記-Monotonic queue/Stack

239. Sliding Window Maximum  https://www.youtube.com/watch?v=2SXqBsTR6a8 class Solution(object): def maxSlidingWi

原创 Leetcode刷題筆記-dp

44. Wildcard Matching func isMatch(s string, p string) bool { dp := make([][]bool, len(s)+1) // dp[s_idx][p_idx]

原创 Leetcode刷題筆記-Array2

386. Lexicographical Numbers   class Solution(object): def lexicalOrder(self, n): def dfs(num):

原创 Python多繼承

參考了這篇博客打了一遍:Python - 對多繼承以及super的一些瞭解 class D(object): def foo(self): print "class D" class B(D): pas

原创 Leetcode刷題筆記-兩點間距離

675. Cut Off Trees for Golf Event class Solution(object): def cutOffTree(self, forest): # add border 0

原创 Leetcode刷題筆記-兩個字符串比較dp

72. Edit Distance f(i, j) := minimum cost (or steps) required to convert first i characters of word1 to first j charac

原创 Leetcode刷題筆記-最大矩形,最大正方形

221. Maximal Square 思路: This problem can be solved by dynamic programming. They key to DP is the state equation. In th

原创 Some Java Knowledge Review

  Set HashMap Reference: https://blog.csdn.net/jiary5201314/article/details/51439982 HashMap is a Map based collection

原创 leetcode刷題筆記-0-1knapsack揹包問題

474. Ones and Zeroes  DP 01揹包問題 思路: For dp[i][j][k], we can get it by fetching the current string i or discarding the

原创 leetcode刷題筆記-graph

310. Minimum Height Trees 思路: 最短的MHT的root是最長的路徑的中間節點。所以最多隻會有2個root。計算所有點的入度,每次去掉入度爲1的節點。對應的鄰居就要入度-1.再次重複步驟去掉入度爲1的節點,直到

原创 leetcode刷題筆記-two pointer

904. Fruit Into Baskets class Solution(object): def totalFruit(self, tree): bucket = {} re = left