Two Sum
Start with the complement lookup pattern, then move into sorted-pair and sliding-window variants.
Curated LeetCode write-ups with original summaries, pattern recognition, and clean C++ implementations aimed at interview preparation. This branch sits between the DSA notebook and the harder contest archives: the emphasis is clarity, reusable patterns, and recruiter-friendly code. Official LeetCode problems are linked on every page instead of being mirrored here.
The first batch is intentionally small. It covers the common array, pointer, stack, traversal, and DP patterns that recur in interviews.
Start with the complement lookup pattern, then move into sorted-pair and sliding-window variants.
Each category groups problems by the main interview pattern, not by difficulty alone. Only completed write-ups appear as public category pages.
Hash-map lookups, prefix-style scans, and the baseline decisions that show up in almost every interview loop.
Sorted-array pairing, duplicate control, and shrinking a search space from both ends.
Grow and shrink a window while maintaining an invariant instead of restarting every substring check.
Classic sorted-array search plus binary search on a monotone feasibility answer.
Monotonic structures and deferred answers for next-greater and range-style problems.
Connectivity, traversal, components, and graph state propagation.
Recursive structure, subtree information, and ancestor-style reasoning.
State design, transition choices, and subproblem reuse without overcomplicating the implementation.
This path optimizes for transfer. Each stage builds on recognition habits from the stage before it.
Start with one-pass array scans, then learn when sorting turns a quadratic search into a pointer walk.
Arrays -> Two Pointers -> Sliding Window
Learn the two big interview accelerators: monotonic stacks for next-greater style queries and binary search on a monotone answer.
Stack -> Binary Search
Practice recursive and graph traversal patterns after the pointer-based problems feel routine.
Tree -> Graph
Dynamic programming becomes much easier once the earlier recognition patterns are stable.
Dynamic Programming
These categories are part of the archive structure already, but they do not appear as public pages until they have finished solutions.
Each page keeps the official link, the rendered explanation, and the exact C++ source on one page.
Return every distinct triplet whose values sum to zero without duplicating answers.
Track the longest contiguous substring whose characters stay unique.
For each day, compute how far away the next warmer temperature appears.
Count how many connected land components appear in a binary grid.
Find the lowest node in a binary tree whose subtree contains both target nodes.
Find the two indices in an unsorted array whose values add up to the target.