- 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.
- LeetCode 51 – N-Queens
The problem people point at when they say backtracking, and it collapses once you see that every row holds exactly one queen — the board stops being a grid and becomes an int[n]. Both diagonals in one test, why no row check is needed, and why this version can skip the undo when the next one cannot.
- LeetCode 49 – Group Anagrams
A hashing problem wearing a string problem's clothes. Find something identical for anagrams and different for everything else, then group by it. Sorting each word works; counting letters is better. And the separator everyone forgets — without it a word with 1 a and 11 b's collides with one that has 11 a's and 1 b.
- MySQL – UPDATE
Changing rows that already exist. UPDATE with WHERE and the habit that saves you — run it as a SELECT first, UPDATE with a JOIN for a backfill, updating from a subquery, ORDER BY and LIMIT on an UPDATE to work through a large table in batches, and `sql_safe_updates`, the setting that refuses an UPDATE with no WHERE clause before it becomes an incident.