Deep Dive

Every core topic, one idea per step. Use ← → to move.

  1. Arrays & Strings

    1Two PointersOne pointer from each end.6 steps
  2. 2Sliding WindowGrow right, shrink left.15 steps
  3. 3Prefix Sum + Hash MapRunning totals remember the past.8 steps
  4. 4Kadane's AlgorithmDrop the run when it goes negative.10 steps
  5. 5Dutch National FlagThree pointers, one pass.8 steps
  6. 6Trapping Rain WaterMove the lower wall inward.11 steps
  7. 7Product Except SelfLeft products × right products.10 steps
  8. 8Merge IntervalsSort, then extend or start new.7 steps
  9. Binary Search

    9Binary SearchHalve the search each step.3 steps
  10. 10Search Rotated ArrayOne half is always sorted.4 steps
  11. 11Binary Search on the AnswerSearch the answer space.6 steps
  12. Sorting

    12Bubble SortBig numbers bubble to the end.14 steps
  13. 13Selection SortPick the smallest, place it.12 steps
  14. 14Insertion SortSlide each card into place.7 steps
  15. 15Merge SortSplit, sort halves, merge.9 steps
  16. 16Quick SortPartition around a pivot.8 steps
  17. 17Counting SortCount, don't compare.9 steps
  18. Linked Lists

    18Reverse a Linked Listprev, cur, next: flip arrows.12 steps
  19. 19Fast & Slow PointersFast laps slow inside a loop.6 steps
  20. 20Merge Two Sorted ListsTake the smaller front.8 steps
  21. 21Remove Nth From EndA fixed gap between two pointers.4 steps
  22. Stacks & Queues

    22Stack: Valid ParenthesesLast opened, first closed.8 steps
  23. 23Monotonic StackWaiting items, popped by a bigger one.9 steps
  24. 24Largest Rectangle in HistogramMeasure a bar when a shorter one arrives.8 steps
  25. 25Min StackA twin stack of minimums.7 steps
  26. 26Sliding Window MaximumA deque of possible maxes.10 steps
  27. Hashing

    27How a Hash Map WorksBuckets, hashing and collisions.7 steps
  28. 28Two Sum (Hash Map)Ask the map for the partner.3 steps
  29. 29Group AnagramsSorted letters as the key.8 steps
  30. 30Longest Consecutive SequenceOnly count from run starts.8 steps
  31. Trees

    31Tree Traversals (DFS)Pre, in and post order.18 steps
  32. 32Level Order (BFS)A queue, one level at a time.4 steps
  33. 33Max Depth (Recursion)1 + taller child.7 steps
  34. 34Invert Binary TreeSwap left and right everywhere.5 steps
  35. 35Validate BSTPass an allowed range down.5 steps
  36. 36BST Search & InsertGo left or right, like binary search.5 steps
  37. 37Lowest Common AncestorWhere the two paths split.3 steps
  38. 38Diameter of a TreeLeft height + right height.8 steps
  39. Heaps

    39Heap: Push & PopBubble up, sink down.12 steps
  40. 40Kth Largest (Heap)A size-k min-heap.8 steps
  41. 41Median: Two HeapsMax-heap low half, min-heap high half.6 steps
  42. 42Merge K Sorted ListsA heap of the k fronts.7 steps
  43. Tries & Range Trees

    43Trie (Prefix Tree)Shared prefixes share a path.5 steps
  44. 44Segment TreeRange sums and updates in log n.6 steps
  45. Backtracking

    45Subsets (Backtracking)Take it or skip it.13 steps
  46. 46PermutationsFill slots, undo, try next.17 steps
  47. 47N-QueensRow by row, undo dead ends.14 steps
  48. Dynamic Programming

    48MemoizationWrite the answers down.6 steps
  49. 49Climbing Stairsways(i) = ways(i−1) + ways(i−2).7 steps
  50. 50House RobberSkip it, or rob + two back.7 steps
  51. 51Coin ChangeTry every coin as the last one.8 steps
  52. 52Longest Increasing SubsequenceExtend the best smaller chain.8 steps
  53. 53Word BreakCan the first i letters split?4 steps
  54. 54Longest Palindromic SubstringExpand around every centre.7 steps
  55. 55Longest Common SubsequenceMatch: diagonal + 1. Else: best of up or left.17 steps
  56. 56Edit DistanceInsert, delete or replace: 1 + min.17 steps
  57. 570/1 KnapsackTake the item or leave it.12 steps
  58. 58Unique PathsWays from above + ways from the left.8 steps
  59. Graph search

    59Word Ladder (BFS)A hidden graph, solved with BFS.16 steps
  60. 60Bridges (Tarjan)DFS with visit time and lowest reach.15 steps
  61. 61Is Graph BipartiteTwo teams, rivals never together.9 steps
  62. 62Minimum Height TreesPeel leaves until the centre is left.4 steps
  63. 63Rotting OrangesMulti-source BFS, one layer a minute.6 steps
  64. 64Union-FindLeaders and merging groups.6 steps
  65. 65Graph BFSA queue explores in rings.9 steps
  66. 66Graph DFSA stack dives deep first.9 steps
  67. 67Number of IslandsCount, then flood-fill.7 steps
  68. Shortest paths

    68Dijkstra's AlgorithmAlways lock the closest node next.21 steps
  69. 69Bellman-Ford with K stopsOne round adds one more flight.11 steps
  70. 70Swim in Rising WaterDijkstra where cost is the highest step.8 steps
  71. 71Floyd-WarshallEvery city as a stop-over.6 steps
  72. Ordering

    72Topological SortTake what's ready, unlock what's next.16 steps
  73. 73Alien DictionaryRules from word pairs, then topo sort.12 steps
  74. 74Cycle in a Directed GraphDFS with three states finds loops.7 steps
  75. Spanning trees

    75Kruskal + Union-FindCheapest road first, skip loops.8 steps
  76. 76Prim's AlgorithmGrow one group, cheapest edge out.13 steps
  77. Bit Manipulation

    77XOR TrickPairs cancel with XOR.7 steps
  78. Design

    78LRU CacheA map plus a doubly linked list.8 steps