Dynamic-Programming
LeetCode 746: Min Cost Climbing Stairs
·2 mins
LeetCode
Easy
Dynamic-Programming
LeetCode note for Min Cost Climbing Stairs, rebuilt from the original learning note
LeetCode 740: Delete and Earn
·2 mins
LeetCode
Medium
Dynamic-Programming
LeetCode note for Delete and Earn, rebuilt from the original learning note
LeetCode 322: Coin Change
·2 mins
LeetCode
Medium
Dynamic-Programming
Unbounded-Knapsack
LeetCode note for Coin Change, rebuilt from the original learning note
LeetCode 213: House Robber II
·2 mins
LeetCode
Medium
Dynamic-Programming
LeetCode note for House Robber II, rebuilt from the original learning note
LeetCode 70: Climbing Stairs
·2 mins
LeetCode
Easy
Dynamic-Programming
LeetCode note for Climbing Stairs, rebuilt from the original learning note
LeetCode 3906: Count Good Integers on a Grid Path
·2 mins
LeetCode
Hard
Dynamic-Programming
Digit-Dp
LeetCode 3906 note: the range reaches 9 × 10^15, so no per-number checks; a digit DP carries both lower and upper tight flags, plus the previous digit on the path since path cells must be non-decreasing
LeetCode 3840: House Robber V
·2 mins
LeetCode
Medium
Dynamic-Programming
Array
LeetCode 3840 note: houses conflict only when adjacent with the same color; take a house outright when the colors differ, and do the House Robber choice only when they match
LeetCode 2054: Two Best Non-Overlapping Events
·2 mins
LeetCode
Medium
Dynamic-Programming
Binary-Search
Sorting
Heap
LeetCode 2054 note: with at most two events, pair each event with the most valuable event that ends before it starts; sort by end time and use a prefix max with binary search
LeetCode 1537: Get the Maximum Score
·3 mins
LeetCode
Hard
Dynamic-Programming
Two-Pointers
Greedy
Array
LeetCode 1537 note: two sorted arrays can switch only at shared values; merge with two pointers, keep a running sum per path, and at a shared value set both to the larger sum plus that value
LeetCode 1458: Max Dot Product of Two Subsequences
·2 mins
LeetCode
Hard
Dynamic-Programming
Longest-Common-Subsequence
Array
LeetCode 1458 note: a two-prefix DP; dp[i][j] either pairs nums1[i] with nums2[j] (extending dp[i-1][j-1] or starting fresh) or skips one of them
LeetCode 1888: Minimum Number of Flips to Make the Binary String Alternating
·2 mins
LeetCode
Medium
Sliding-Window
String
Dynamic-Programming
LeetCode 1888 note: rotations become length-n windows over s + s; the window’s mismatches against 0101… are diff, and against 1010… they are n - diff
LeetCode 1493: Longest Subarray of 1's After Deleting One Element
·2 mins
LeetCode
Medium
Sliding-Window
Dynamic-Programming
Array
LeetCode 1493 note: find the longest window with at most one 0; since one element must be deleted, the answer is the window length minus 1