- LeetCode 41 – First Missing Positive
Hard because of its constraints, not its question — a hash set solves it instantly, and O(1) space forbids one. Everything follows from a single observation: with n elements the answer is always in [1, n + 1], so every other value is noise. Cyclic sort uses the array as its own hash table, and the nested loop really is O(n).
- MySQL – Self Join
Joining a table to itself, which is not a special kind of join — it is an ordinary join where both aliases point at the same table. Why the aliases stop being optional, comparing rows within a table, finding pairs without duplicating them with `a.id < b.id`, and the classic employee-and-manager shape done on a table you can actually see.
- LeetCode 40 – Combination Sum II
Combination Sum with two changes: each element used once, and the input may contain duplicates. The first is one character; the second is one line — and `i > start` rather than `i > 0` is the most misunderstood condition in the backtracking family. Getting it wrong does not duplicate answers, it loses them, which is far harder to notice.
- AWS – The CLI: Profiles, Queries and the Flags That Bite
Named profiles so you never run a command against the wrong account, SSO login, and `--query` — JMESPath — which turns a screenful of JSON into the one field you wanted. Then the flags that have cost real time on this site: `s3 sync` skips unchanged files so metadata never updates, `--exact-timestamps` is not a tidy-up, and `--metadata-directive REPLACE` without `--content-type` rewrites every object.
- MySQL – CROSS JOIN
Every row on the left paired with every row on the right. The Cartesian product, how CROSS JOIN differs from a comma join with no WHERE (it does not), the row count arithmetic that makes an accidental one so expensive, and the case where you actually want it: generating a complete grid — every product against every size — to find the combinations that are missing.