DevLift

Blog

Tutorials, guides, and insights to help you become a better developer.

Clear
The XOR and popcount tricks behind Single Number, Missing Number and Counting Bits are small enough to verify exhaustively, so this runs them over every input they claim to cover and reports the exact value at which each one stops being correct.
AdminSeptember 3, 20268 min read
Evaluating Reverse Polish Notation Is Easy. Rejecting Bad Input Is the Job.
The stack loop that evaluates an RPN expression is fifteen lines, but it returns undefined for an empty array, NaN for a missing operand and -0 for a negative fraction, so the real work is deciding what your evaluator owes a caller who hands it nonsense.
AdminAugust 18, 20269 min read
Union Find: The Structure That Only Answers "Same Group?"
Union Find trades every graph question except one for speed, and measured tree heights show exactly what path compression and union by rank each buy you — with tested solutions to Redundant Connection, Number of Connected Components, and Accounts Merge.
AdminAugust 6, 20268 min read
A monotonic stack maintains elements in order and pops when that order breaks — finding the next greater element for every popped value in O(n) total.
AdminAugust 3, 20265 min read
The Two Sum problem is the "Hello World" of hash map problems. Most people solve it, move on, and treat it as a warmup. That's a mistake. The pattern behind Two Sum — trading space for lookup speed — shows up in dozens of harder problems.
AdminJuly 27, 20265 min read
Your Node.js server calls res.send("hello") and somewhere, 1400 bytes cross the planet in 80 milliseconds and appear correctly in a browser. That's wild. But what actually happens?
AdminApril 27, 20269 min read
Two mid-to-senior linked list problems that test data structure design: deep-copying a list with random pointers (O(1) space trick), and implementing LRU Cache in O(1).
AdminMarch 19, 20265 min read
Sliding window maximum is the classic follow-up to every sliding window problem. Learn the monotone deque pattern in JavaScript with LeetCode 239, 1438, and 1696.
AdminMarch 17, 20268 min read
LC 297 is a Hard but the insight is simple: null markers make any traversal unambiguous. Learn preorder DFS and BFS serialization, plus the BST shortcut for LC 449.
AdminMarch 13, 20268 min read
Page 1 of 4Next

Stay in the Loop

Get notified about new courses, tutorials, and learning tips. No spam, unsubscribe anytime.