Learn
Seventeen areas, taken in order. Each area is a set of patterns, and each pattern has a lesson and its problems.
- How to think
What DSA is, reading constraints, dry runs, and the maths, recursion, hashing and sorting you need first.
7 patterns, 32 problems
- Arrays
In-place tricks, prefix sums, two pointers, sliding window and the classic array patterns.
13 patterns, 85 problems
- Binary search
Searching sorted data, rotated arrays, and binary search on the answer.
5 patterns, 40 problems
- Linked lists
Pointer manipulation: dummy nodes, fast and slow pointers, reversal and merging.
6 patterns, 56 problems
- Recursion and backtracking
Exploring choices with a recursion tree and undoing them.
11 patterns, 34 problems
- Stacks and queues
Last-in-first-out and first-in-first-out thinking, monotonic stacks, design problems.
8 patterns, 47 problems
- Graphs
Representations, traversals, shortest paths, spanning trees and connectivity.
12 patterns, 67 problems
- Dynamic programming
Recursion, memoisation, tabulation and space optimisation as one repeated recipe.
11 patterns, 86 problems