Dynamic-Programming
LeetCode 1526: Minimum Number of Increments on Subarrays to Form a Target Array
·1 min
LeetCode
Hard
Dynamic-Programming
Greedy
Monotonic-Stack
Array
LeetCode 1526 note: scanning left to right, every rise above the previous height needs that many new operations; drops reuse earlier operations
LeetCode 1277: Count Square Submatrices With All Ones
·3 mins
LeetCode
Medium
Dynamic-Programming
Grid-Dp
LeetCode note for Count Square Submatrices With All Ones, rebuilt from the original learning note
LeetCode 1335: Minimum Difficulty of a Job Schedule
·2 mins
LeetCode
Hard
Dynamic-Programming
Interval-Dp
Array
LeetCode 1335 note: partition DP into d segments; dp(i, k) = the least difficulty starting at job i with k days left, enumerating where today ends while updating today’s maximum
LeetCode 1147: Longest Chunked Palindrome Decomposition
·2 mins
LeetCode
Hard
Dynamic-Programming
Greedy
Two-Pointers
Rolling-Hash
String
LeetCode 1147 note: build strings inward from both ends and cut a pair as soon as they match; cutting early is best, and any leftover middle counts as one chunk
LeetCode 221: Maximal Square
·4 mins
LeetCode
Medium
Dynamic-Programming
Grid-Dp
LeetCode note for Maximal Square, rebuilt from the original learning note
LeetCode 174: Dungeon Game
·3 mins
LeetCode
Hard
Dynamic-Programming
Grid-Dp
LeetCode note for Dungeon Game, rebuilt from the original learning note
LeetCode 64: Minimum Path Sum
·3 mins
LeetCode
Medium
Dynamic-Programming
Grid-Dp
LeetCode note for Minimum Path Sum, rebuilt from the original learning note
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