Deep Dive
Every core topic, one idea per step. Use ← → to move.
Arrays & Strings
1Two PointersOne pointer from each end.6 steps- 2Sliding WindowGrow right, shrink left.15 steps
- 3Prefix Sum + Hash MapRunning totals remember the past.8 steps
- 4Kadane's AlgorithmDrop the run when it goes negative.10 steps
- 5Dutch National FlagThree pointers, one pass.8 steps
- 6Trapping Rain WaterMove the lower wall inward.11 steps
- 7Product Except SelfLeft products × right products.10 steps
- 8Merge IntervalsSort, then extend or start new.7 steps
Binary Search
9Binary SearchHalve the search each step.3 steps- 10Search Rotated ArrayOne half is always sorted.4 steps
- 11Binary Search on the AnswerSearch the answer space.6 steps
Sorting
12Bubble SortBig numbers bubble to the end.14 steps- 13Selection SortPick the smallest, place it.12 steps
- 14Insertion SortSlide each card into place.7 steps
- 15Merge SortSplit, sort halves, merge.9 steps
- 16Quick SortPartition around a pivot.8 steps
- 17Counting SortCount, don't compare.9 steps
Linked Lists
18Reverse a Linked Listprev, cur, next: flip arrows.12 steps- 19Fast & Slow PointersFast laps slow inside a loop.6 steps
- 20Merge Two Sorted ListsTake the smaller front.8 steps
- 21Remove Nth From EndA fixed gap between two pointers.4 steps
Stacks & Queues
22Stack: Valid ParenthesesLast opened, first closed.8 steps- 23Monotonic StackWaiting items, popped by a bigger one.9 steps
- 24Largest Rectangle in HistogramMeasure a bar when a shorter one arrives.8 steps
- 25Min StackA twin stack of minimums.7 steps
- 26Sliding Window MaximumA deque of possible maxes.10 steps
Hashing
27How a Hash Map WorksBuckets, hashing and collisions.7 steps- 28Two Sum (Hash Map)Ask the map for the partner.3 steps
- 29Group AnagramsSorted letters as the key.8 steps
- 30Longest Consecutive SequenceOnly count from run starts.8 steps
Trees
31Tree Traversals (DFS)Pre, in and post order.18 steps- 32Level Order (BFS)A queue, one level at a time.4 steps
- 33Max Depth (Recursion)1 + taller child.7 steps
- 34Invert Binary TreeSwap left and right everywhere.5 steps
- 35Validate BSTPass an allowed range down.5 steps
- 36BST Search & InsertGo left or right, like binary search.5 steps
- 37Lowest Common AncestorWhere the two paths split.3 steps
- 38Diameter of a TreeLeft height + right height.8 steps
Heaps
39Heap: Push & PopBubble up, sink down.12 steps- 40Kth Largest (Heap)A size-k min-heap.8 steps
- 41Median: Two HeapsMax-heap low half, min-heap high half.6 steps
- 42Merge K Sorted ListsA heap of the k fronts.7 steps
Tries & Range Trees
43Trie (Prefix Tree)Shared prefixes share a path.5 steps- 44Segment TreeRange sums and updates in log n.6 steps
Backtracking
45Subsets (Backtracking)Take it or skip it.13 steps- 46PermutationsFill slots, undo, try next.17 steps
- 47N-QueensRow by row, undo dead ends.14 steps
Dynamic Programming
48MemoizationWrite the answers down.6 steps- 49Climbing Stairsways(i) = ways(i−1) + ways(i−2).7 steps
- 50House RobberSkip it, or rob + two back.7 steps
- 51Coin ChangeTry every coin as the last one.8 steps
- 52Longest Increasing SubsequenceExtend the best smaller chain.8 steps
- 53Word BreakCan the first i letters split?4 steps
- 54Longest Palindromic SubstringExpand around every centre.7 steps
- 55Longest Common SubsequenceMatch: diagonal + 1. Else: best of up or left.17 steps
- 56Edit DistanceInsert, delete or replace: 1 + min.17 steps
- 570/1 KnapsackTake the item or leave it.12 steps
- 58Unique PathsWays from above + ways from the left.8 steps
Graph search
59Word Ladder (BFS)A hidden graph, solved with BFS.16 steps- 60Bridges (Tarjan)DFS with visit time and lowest reach.15 steps
- 61Is Graph BipartiteTwo teams, rivals never together.9 steps
- 62Minimum Height TreesPeel leaves until the centre is left.4 steps
- 63Rotting OrangesMulti-source BFS, one layer a minute.6 steps
- 64Union-FindLeaders and merging groups.6 steps
- 65Graph BFSA queue explores in rings.9 steps
- 66Graph DFSA stack dives deep first.9 steps
- 67Number of IslandsCount, then flood-fill.7 steps
Shortest paths
68Dijkstra's AlgorithmAlways lock the closest node next.21 steps- 69Bellman-Ford with K stopsOne round adds one more flight.11 steps
- 70Swim in Rising WaterDijkstra where cost is the highest step.8 steps
- 71Floyd-WarshallEvery city as a stop-over.6 steps
Ordering
72Topological SortTake what's ready, unlock what's next.16 steps- 73Alien DictionaryRules from word pairs, then topo sort.12 steps
- 74Cycle in a Directed GraphDFS with three states finds loops.7 steps
Spanning trees
75Kruskal + Union-FindCheapest road first, skip loops.8 steps- 76Prim's AlgorithmGrow one group, cheapest edge out.13 steps
Bit Manipulation
77XOR TrickPairs cancel with XOR.7 stepsDesign
78LRU CacheA map plus a doubly linked list.8 steps