WRITING
Notes on building and running systems
Engineering write-ups — architecture, security, and the occasional war story.
#dp · All writing
Series
Tags
- #leetcode 50
- #array 13
- #dfs 11
- #bfs 9
- #dynamic-programming 9
- #recursion 9
- #trees 7
- #arrays 6
- #binary-search 6
- #hash-table 6
- #string 6
- #two-pointers 6
- #backtracking 4
- #dp 4
- #graphs 4
- #greedy 4
- #matrix 4
- #sliding-window 4
- #hash-map 3
- #heap-priority-queue 3
- #linked-list 3
- #stack 3
- #binary-search-tree 2
- #heap 2
- #math 2
- #memoization 2
- #priority-queue 2
- #sorting 2
- #strings 2
- #binary-tree 1
- #bit-manipulation 1
- #bucket-sort 1
- #counting 1
- #cycle-detection 1
- #divide-and-conquer 1
- #geometry 1
- #kadane 1
- #multi-source-bfs 1
- #prefix-sum 1
- #quickselect 1
- #simulation 1
- #string-matching 1
- #topological-sort 1
- #union-find 1
01
Bottom-Up DP Beats Recursion: Solving Coin Change in O(S×n)
LeetCode 322 is the textbook unbounded knapsack problem. Walk through all four approaches — brute force recursion, top-down memoization, bottom-up tabulation, and BFS — to understand exactly why the dp table works and when each version earns its place.Jun 14, 2026 · 11 min read · #00049
02
Tracking Min and Max Together: Why the Product Subarray Problem Breaks Kadane's
LeetCode 152 looks identical to Maximum Subarray until a negative number shows up and flips everything. Walk through brute force and the two-lookback DP that handles sign flips — with a full trace, edge-case analysis, and the mental model you carry to future problems.Jun 14, 2026 · 8 min read · #00052
03
Two Ways to Find the Longest Increasing Subsequence — and Why O(n log n) Works
LeetCode 300 looks deceptively simple — find the longest strictly increasing subsequence. The O(n²) DP is the obvious first step, but the O(n log n) binary search approach is the one worth understanding deeply: it rewires how you think about subsequence state.Jun 14, 2026 · 10 min read · #00050
04
String Segmentation Is Just a DP Reachability Problem: Solving Word Break
LeetCode 139 looks like a string-matching puzzle but is really a reachability question over indices. Walk through all three approaches — brute-force recursion, top-down memoization, and bottom-up tabulation — to see exactly why the dp array works and which version holds up under real constraints.Jun 14, 2026 · 10 min read · #00051
Occasional notes on what I'm building
Get an email when I publish a new post — engineering write-ups, no spam. Unsubscribe anytime.