Every solution in this repository is organised around one of these sixteen cross-cutting patterns. Each entry lists representative problems to start with; the full topic-by-topic roadmap lives in the README.
- Two Pointers & Sliding Window — converging pointers over sorted data, or a window that maintains an invariant while it expands and contracts. → 1. Two Sum · 42. Trapping Rain Water · 167. Two Sum II
- Fast & Slow Pointers (Cycle Detection) — two pointers at different speeds to detect cycles, find midpoints, or locate an entry point without extra space. → 148. Sort List · 287. Find the Duplicate Number
- Merge Intervals — sort by start, then sweep while comparing each interval's start against the running end. → 56. Merge Intervals · 435. Non-overlapping Intervals
- Monotonic Stack & Deque — keep candidates in monotonic order so each element is pushed and popped at most once. → 84. Largest Rectangle in Histogram · 239. Sliding Window Maximum
- Tree DFS & BFS Traversals — recursive pre/in/post-order passes, or level-order queues for depth-wise answers. → 94. Binary Tree Inorder Traversal · 102. Level Order Traversal · 199. Right Side View
- Graph Topological Sort & DSU — ordering under dependency constraints, or union-find for connectivity and cycle detection. → 207. Course Schedule · 547. Number of Provinces · 684. Redundant Connection
- Dynamic Programming (State Compression) — define the state, the transition, and the base case, then compress dimensions you no longer read. → 322. Coin Change · 300. Longest Increasing Subsequence · 1143. Longest Common Subsequence
- Backtracking & Branch Pruning — choose, explore, un-choose, and cut branches that cannot lead to a valid answer. → 51. N-Queens · 40. Combination Sum II · 37. Sudoku Solver
- Binary Search on Sorted & Rotated Arrays — halve the search space by exploiting order, including rotated pivots and answer-space search. → 704. Binary Search · 33. Search in Rotated Sorted Array
- Heaps & Top-K Selection — a bounded heap or quickselect keeps only the k elements that matter. → 215. Kth Largest Element · 347. Top K Frequent Elements · 23. Merge k Sorted Lists
- Trie & Prefix Search — a character-indexed tree answers prefix queries in O(L) and shares work across words. → 208. Implement Trie · 211. Add and Search Words
- Greedy Scan & Kadane's Algorithm — commit to the locally optimal choice and prove the running state never needs to look back. → 53. Maximum Subarray · 55. Jump Game
- Prefix Sums & Difference Arrays — precompute cumulative state so range queries and range updates become O(1). → 303. Range Sum Query Immutable · 560. Subarray Sum Equals K · 370. Range Addition
- Grid Traversal (BFS/DFS on Matrices) — treat cells as nodes and four-directional moves as edges, in place when possible. → 200. Number of Islands · 130. Surrounded Regions · 695. Max Area of Island
- Design Data Structures (Hash + Linked List) — combine a map for O(1) lookup with a list for O(1) eviction or ordering. → 146. LRU Cache · 155. Min Stack
- Bit Manipulation & XOR — exploit word-level parallelism, XOR cancellation, and bit counting instead of per-element work. → 136. Single Number · 137. Single Number II · 191. Number of 1 Bits
These sixteen are cross-cutting families, not an exhaustive labelling: every problem is additionally filed under its own LeetCode topic in the README roadmap.