
LeetCode Patterns
Algorithms by pattern, with worked solutions.
01LeetCode (1): Patterns — Hash Tables
Master hash table patterns through four classic LeetCode problems — Two Sum, Group Anagrams, Longest Substring Without …
02LeetCode (2): Patterns — Two Pointers
A deep tour of the two-pointer family: collision, fast/slow, sliding window, and partition pointers. Five problems (Two …
03LeetCode (3): Patterns — Linked List Operations
A complete linked list toolkit: reversal (iterative and recursive), merging sorted lists, Floyd's cycle detection, …
04LeetCode (4): Patterns — Sliding Window Technique
Master fixed-size and variable-size sliding window patterns. Solve Maximum Sum Subarray, Longest Substring Without …
05LeetCode (5): Patterns — Binary Search
A working coder's guide to binary search: three templates, rotated arrays, peak finding, and binary search on the answer …
06LeetCode (6): Patterns — Binary Tree Traversal and Construction
A unified mental model for binary trees: how the four traversal orders are really one DFS recipe, why recursion and an …
07LeetCode (7): Patterns — Dynamic Programming Basics
Master dynamic programming through a single recipe: define the state, write the transition, anchor the base case. Worked …
08LeetCode (8): Patterns — Backtracking Algorithms
Master the universal backtracking template through six classic problems: Permutations, Combinations, Subsets, Word …
09LeetCode (9): Patterns — Greedy Algorithms
When does picking the locally best option give the global optimum? A working tour of greedy algorithms with proofs …
10LeetCode (10): Patterns — Stack and Queue
Master stack and queue applications: valid parentheses, monotonic stack for next greater element, BFS with queues, …