LeetCode Templates
LeetCode Templates
Master index and category collections of solution patterns and Meta practice lists
Arrays & Strings
Sliding Window, Two Pointers, Binary Search, Prefix Sum, Hash Map, KMP, Manacher, Z-Algorithm, Rolling Hash
Data Structures
Monotonic Stack/Queue, Heap, Union-Find, Trie, Segment Tree, Fenwick Tree, Bitwise Trie
Graph
BFS, Multi-source BFS, Bitmask BFS, Topological Sort, Dijkstra, 0-1 BFS, Tarjan/Bridges
Trees
Traversals, LCA (binary lifting), HLD skeleton
Dynamic Programming
1D/Knapsack, 2D/Grid, Digit DP, Bitmask DP
Math & Geometry
nCk mod P, factorials, geometry primitives and cross products
Advanced Techniques
Coordinate Compression, Meet-in-the-Middle, Manacher, Z-Algorithm, Bitwise Trie