- LeetCode 56 – Merge Intervals
The gateway to every interval problem, carried almost entirely by one decision: sort by start. Why that reduces overlap to a single comparison against the last output, why the merged end must be a max, why a[0] - b[0] as a comparator is a production bug, and when to sort by end instead.
- AWS – DynamoDB: Keys, Indexes and Access Patterns
DynamoDB rewards you for knowing your queries before you design your table, and punishes you for anything else. Partition key and sort key, why a scan is a bug, and the single-table pattern in the smallest example that shows why it exists. GSIs and LSIs and the difference that cannot be undone after creation, on-demand versus provisioned, and the hot partition that throttles a table that looks under quota.
- LeetCode 55 – Jump Game
A greedy problem that spends most of its time disguised as dynamic programming. nums[i] is a maximum, not an exact jump, which makes the reachable set a prefix with no holes — and that is the justification the greedy needs. One variable replaces the whole DP table, plus the backward version for when you are asked to flip it.
- LeetCode 53 – Maximum Subarray
The smallest problem that is genuinely dynamic programming, and almost everyone gets it nearly right then fails on an all-negative array. Deriving Kadane rather than recalling it, why best = 0 is the near-miss, keeping best and endingHere distinct, and the follow-up that asks where the subarray actually starts.
- LeetCode 52 – N-Queens II
The same search asked for a count instead of the boards, and calling problem 51 and returning size() is exactly the answer it is designed to catch. Marking row - col and row + col makes the legality test O(1), the undo becomes mandatory, and the bitmask version is there if you are asked to go faster.