- LeetCode 122 – Best Time to Buy and Sell Stock II
A rare case where removing a constraint makes the problem easier. Every profit is a sum of consecutive daily deltas, so take every positive one — and that derivation is what turns a greedy that looks like cheating into one that is obviously optimal. Plus the two-state form that survives fees, cooldowns and caps.
- AWS – Lambda: Handlers, Cold Starts and Packaging
The handler signature, what actually lives in the execution context between invocations, and why that one fact decides where you open a database connection. Cold starts measured rather than feared, memory as the CPU dial it really is, layers versus a zip versus a container image, and the packaging trap that ships a Lambda which dies at import: compiled wheels built for your laptop instead of for Lambda.
- LeetCode 121 – Best Time to Buy and Sell Stock
Worth more than its Easy tag, because the reframing it teaches is the one behind Kadane's algorithm and most 1-D DP. The brute force asks which pair of days is best; the linear solution asks what the best buy was if I sell today — and that has a one-variable answer. Why a falling market returns 0, and why this is Maximum Subarray in disguise.
- MySQL – INFORMATION_SCHEMA
Querying the database about itself. TABLES, COLUMNS, STATISTICS, KEY_COLUMN_USAGE and REFERENTIAL_CONSTRAINTS, finding every foreign key pointing at a table before you drop it, listing indexes that duplicate each other, estimating table and index size on disk, why TABLE_ROWS is an estimate and not a count, and how SHOW commands map onto the same data.
- LeetCode 119 – Pascal's Triangle II
One row, in O(k) space, which turns a warm-up into a real exercise in updating an array without destroying what you are about to read. Sweep right to left so the stale values survive — the same rule that separates 0/1 knapsack from unbounded, and the question is always which values the cell needs.