Sliding Window Pattern: How to Turn Nested Loops Into Linear Time
Learn when to use sliding windows, how fixed and variable windows differ, and how to solve classic substring and subarray problems efficiently.
Patterns, walkthroughs, and tips for coding interviews.
Learn when to use sliding windows, how fixed and variable windows differ, and how to solve classic substring and subarray problems efficiently.
Understand classic binary search, boundary search, and the broader decision-based pattern that helps solve optimization problems in logarithmic time.
Learn how prefix sums turn repeated range calculations from linear work into constant-time queries, and see how the pattern extends to hash maps and subarray problems.
See how monotonic stacks help solve next greater, previous smaller, and histogram-style problems in linear time without brute force.
Learn the recursive choose-explore-unchoose pattern behind subsets, permutations, combinations, and many classic search problems.
A practical guide to recognizing dynamic programming problems, choosing states, and moving from brute force recursion to memoization and tabulation.
Understand the difference between breadth-first and depth-first search, when each traversal is the right fit, and how they show up in trees, graphs, and grids.
Learn when heaps are the right data structure, how min-heaps and max-heaps work, and why they shine in top-k and streaming problems.
Understand disjoint set union, path compression, and union by rank so you can solve connectivity problems efficiently.
Learn how topological sorting works, why it only applies to DAGs, and how to solve course scheduling and dependency ordering problems.
Learn how the two pointers technique works, when to use it, and walk through classic problems like Two Sum II and Container With Most Water.