Blog
Tutorials, guides, and insights to help you become a better developer.
Delete the `if (!numSet.has(num - 1))` guard from the standard LeetCode 128 solution and every test still passes, but the inner loop jumps from 31,999 iterations to 511,984,000 at n = 32,000.
AdminSeptember 18, 20266 min read

LeetCode 621 has two unrelated correct solutions — a heap simulation and a one-line formula — so running them against every task multiset up to size 14 crossed with every cooldown from 0 to 40 is a stronger test than any example you would write by hand.
AdminSeptember 17, 20266 min read

Collapsing the 0/1 knapsack DP table into a single array is taught as a free win, but it destroys the record of which items were chosen and introduces a loop-direction bug that returns a plausible wrong answer on roughly four instances in five.
AdminSeptember 16, 20267 min read

I sent the same query down a transaction-mode pooler and a session-mode one into the same Postgres instance, and wrote down every place the answers diverged.
AdminSeptember 15, 20268 min read
A sensitive column passes through five hops on its way from Postgres to a browser, and a Prisma select only closes the first one — this traces all five with measured runs, including the RSC payload that a TypeScript props interface does not narrow.
AdminSeptember 14, 20266 min read
Bucket sort is O(n) and a size-k min-heap is O(n log k), but timing both on two million integers shows the comparison is decided by how many buckets you allocate rather than by k.
AdminSeptember 11, 20266 min read

Following a single authorization-code-plus-PKCE login request by request, showing at each hop what an attacker who owns that hop can do and which parameter takes the capability away.
AdminSeptember 10, 20269 min read
Ten small programs, each one producing a real error that disappears without a log, a stack trace or a non-zero exit code, with the measured output that proves it and the rule or line that finally made it visible.
AdminSeptember 9, 20269 min read
Nearly every explanation of LeetCode 84 says the monotonic stack stays strictly increasing, and an assertion dropped into the loop shows that is false on 45,502 of 50,000 random histograms.
AdminSeptember 8, 20267 min read
Page 1 of 16Next