TODO List

2/17/2018

  • 644 Maximum Average Subarray II (H, TBD)

2/21/2018

  • 714 Best Time to Buy and Sell Stock with Transaction Fee (M, DP)

2/22/2018

  • 731 My Calendar II (M, check overlap among all the overlapped intervals)

2/23/2018

  • 731 My Calendar II (每次call book(s, e),都会check all the previous intervals and put overlapped interval into calendarOne)'

  • 729 My Calendar I (M)

  • 723 Candy Crush (M, 花了一个小时,从逻辑、效率、代码质量等不同角度进行了理解。)

  • 775 Global and Local Inversion (M, if there exist non-local inversion, then we return false)

  • 548 Split Array with Equal Sum (M, 一般涉及到subarray sum的题目,基本上都是先计算sum[i],再根据问题进行推进)

  • 531 Lonely Pixel I (M, 用2个数组分别记录每行和每列B的个数,再从头开始扫一遍)

  • 533 Lonely Pixel II (M, 用1个HashMap记录possible row及其count,再对count == N的row从左往右扫一遍,找valid col)

2/26/2018

  • 109 Convert Sorted List to Binary Search Tree (M, recursively find the middle point)

2/27/2018

  • 133 Clone Graph (M, careful about checking duplicate)

  • 337 House Robber III (M, for every node, keep two values, one for the maximum robbed and one for the max unrobbed)

  • 130 Surrounded Regions (M, first flip all the 'O's connecting to the border into '1', then flip all the rest 'O' into 'X', then flip '1' into 'O' again)

  • 117 Populating Next Right Pointers in Each Node II (M, keep 3 variables, current node, head of the next level, and first node of the next level)

3/1/2018

  • 332 Reconstruct Itinerary

  • 364 Nested List Weight Sum II (M, iterative: keep a global sum var, at each level, add the current sum to global sum; recursion: get the max depth first, then manipulate each level recursively)

  • 529 Minesweeper (M, Be careful about "adjacent cells", that means 8 adjacent cells)

3/6/2018

  • 513 Find Bottom Left Tree Value (M, recursion, pre-order traversal, every time see a deeper level, update rs)

  • 515 Find Largest Value in Each Tree Row (M, recursion or iterative, very straightforward)

3/12/2018

  • 638 Shopping Offers(M, dfs + memo)

  • 366 Find Leaves of Binary Tree (M, bottom up recursion, in-order traversal, every time return the depth from leaves)

  • 682 Baseball Game (E, stack)

  • 496 Next Greater Element I (E, keep a monotonically decreasing stack)

Last updated