↓Skip to main content

LeetCode

LeetCode 63: Unique Paths II
·3 mins
LeetCode Medium Dynamic-Programming Grid-Dp
LeetCode note for Unique Paths II, rebuilt from the original learning note
LeetCode 62: Unique Paths
·3 mins
LeetCode Medium Dynamic-Programming Grid-Dp
LeetCode note for Unique Paths, rebuilt from the original learning note
LeetCode 1745: Palindrome Partitioning IV
·2 mins
LeetCode Hard Dynamic-Programming Interval-Dp String
LeetCode 1745 note: build is_pal[i][j] with interval DP, then try both cut points; three palindromic parts means true, O(n^2)
LeetCode 120: Triangle
·3 mins
LeetCode Medium Dynamic-Programming
LeetCode note for Triangle, rebuilt from the original learning note
LeetCode 3651: Minimum Cost Path with Teleportations
·2 mins
LeetCode Hard Dynamic-Programming Grid-Dp Matrix Array
LeetCode 3651 note: compute layer by layer over teleports; arriving at a cell by teleport costs the previous layer’s minimum over cells with value >= it, found with a running minimum after sorting, followed by the usual right / down grid DP
LeetCode 312: Burst Balloons
·2 mins
LeetCode Hard Dynamic-Programming Interval-Dp Array
LeetCode 312 note: choose the last balloon k burst in the range (i, j); at that moment its neighbors are i and j, and the two sides are independent subproblems
LeetCode 2603: Collect Coins in a Tree
·4 mins
LeetCode Hard Tree Graph Topological-Sort
LeetCode 2603 note: trim coin-free leaves, trim exactly two more layers, and walk each remaining edge twice
LeetCode 2196: Create Binary Tree From Descriptions
·2 mins
LeetCode Medium Tree Binary-Tree Hash-Map
LeetCode 2196 note: keep nodes in a dict and link them in one pass; the root is the only value that is nobody’s child
LeetCode 3660: Jump Game IX
·2 mins
LeetCode Medium Dynamic-Programming Array
LeetCode 3660 note: cutting between i and i+1, if the left max exceeds the right min the two sides reach each other and share the answer; otherwise the left answer is the left max
LeetCode 1878: Get Biggest Three Rhombus Sums in a Grid
·3 mins
LeetCode Medium Matrix Enumeration Heap
LeetCode 1878 note: enumerate every top vertex and size, walk the four edges, and keep the three largest distinct sums
LeetCode 1727: Largest Submatrix With Rearrangements
·2 mins
LeetCode Medium Greedy Sorting Matrix
LeetCode 1727 note: compute each row’s heights of consecutive ones above; columns can be reordered, so sort heights descending and the j-th tallest times j + 1 is a candidate
LeetCode 3713: Longest Balanced Substring I
·2 mins
LeetCode Medium Hash-Table String Counting Enumeration
LeetCode 3713 note: fix the start and extend right; “every character has the same count” means “highest count × kinds = length”, an O(1) check per step