$ cat resources/dsa.md
# dsa
Data structures and algorithms by pattern. Do the core problems of a section first; ★ problems are extra practice for the same pattern.
232 problems · 22 patterns · ★ = extra practice
Arrays & Hashing 17
-
LC 238 Prefix & suffix product
Amazon · Apple · Meta
-
LC 347 Bucket sort / Heap
Amazon · Google · Meta
-
LC 271 String encoding trick
Google · Meta · Amazon
-
LC 54 Layer-by-layer traversal
Amazon · Google · Microsoft · Meta
-
LC 48 In-place matrix transform
Amazon · Google · Microsoft
-
LC 560 Prefix sum + HashMap
Amazon · Google · Meta
-
LC 252 Interval overlap check
Amazon · Google · Meta · Microsoft
- Continuous Subarray Sum (opens in a new tab) medium · ★ extra
LC 523 Prefix sum mod + HashMap
Amazon · Google · Meta
- Subarray Sums Divisible by K (opens in a new tab) medium · ★ extra
LC 974 Prefix sum mod pattern
Amazon · Google
- Range Sum Query 2D (opens in a new tab) medium · ★ extra
LC 304 2D prefix sum
Amazon · Google · Meta
Two Pointers 10
-
LC 11 Greedy two pointer
Amazon · Google · Meta
-
LC 42 Two pointer / monotonic stack
Amazon · Google · Meta
- 3Sum Closest (opens in a new tab) medium · ★ extra
LC 16 Two pointer + closest track
Amazon · Google
Sliding Window 10
-
LC 3 Variable window + set
Amazon · Google · Meta · Microsoft
-
LC 424 Window + freq array trick
Google · Meta · Amazon
-
LC 76 Two pointer window + map
Amazon · Google · Meta
-
LC 567 Fixed window char freq
Amazon · Google · Microsoft
-
LC 438 Sliding window freq match
Amazon · Meta
-
LC 340 Window shrink on constraint
Amazon · Google · Meta
-
LC 1004 Sliding window with budget
Amazon · Google
- Fruit Into Baskets (opens in a new tab) medium · ★ extra
LC 904 At-most-K distinct window
Amazon · Google
- Max Points from Cards (opens in a new tab) medium · ★ extra
LC 1423 Fixed window complement
Amazon · Google · Meta
Stack 13
-
LC 150 Operator stack
Amazon · LinkedIn
-
LC 84 Monotonic stack classic
Amazon · Google · Meta
-
LC 227 Stack + operator precedence
Amazon · Google · Microsoft
- Next Greater Element II (opens in a new tab) medium · ★ extra
LC 503 Mono stack circular
Amazon · Google
- Online Stock Span (opens in a new tab) medium · ★ extra
LC 901 Mono stack span count
Amazon · Google · Meta
- Min Remove to Make Valid Parens (opens in a new tab) medium · ★ extra
LC 1249 Stack index tracking
Amazon · Meta
Binary Search 13
-
LC 74 Flatten matrix binary search
Amazon · Google · Microsoft
-
LC 153 Pivot binary search
Amazon · Google · Microsoft · Apple
-
LC 33 Two-half binary search
Amazon · Google · Meta · Microsoft
-
LC 981 Binary search on sorted list
Amazon · Google · Meta
-
LC 4 Partition binary search
Amazon · Google · Meta
-
LC 528 Prefix sum + binary search
Amazon · Google · Meta
-
LC 34 Lower/upper bound BS
Amazon · Google · Microsoft
- Capacity to Ship Packages in D Days (opens in a new tab) medium · ★ extra
LC 1011 BS on answer — min capacity
Amazon · Google
- Min Days to Make M Bouquets (opens in a new tab) medium · ★ extra
LC 1482 BS on answer — days
Amazon · Google
- Split Array Largest Sum (opens in a new tab) hard · ★ extra
LC 410 BS on answer — max minimize
Amazon · Google · Meta
Linked List 13
-
LC 206 Iterative / recursive reverse
Amazon · Google · Meta · Microsoft
-
LC 21 Dummy node merge
Amazon · Google · Meta · Microsoft
-
LC 23 Heap merge / divide & conquer
Amazon · Google · Meta · Microsoft
-
LC 19 Two pointer gap trick
Amazon · Google · Meta · Microsoft
-
LC 138 HashMap clone
Amazon · Meta · Microsoft
-
LC 2 Carry simulation
Amazon · Google · Meta · Microsoft
-
LC 25 Group pointer manipulation
Amazon · Google · Meta
- Remove Duplicates from Sorted List II (opens in a new tab) medium · ★ extra
LC 82 Skip-node pointer trick
Amazon · Google
Trees 23
-
LC 104 DFS recursion base
Amazon · Google · Microsoft · Apple
-
LC 572 DFS + same tree check
Amazon · Google · Meta
-
LC 102 BFS with queue level split
Amazon · Google · Meta · Microsoft
-
LC 199 BFS last-node per level
Amazon · Meta · Microsoft
-
LC 105 Divide array by root
Amazon · Google · Meta
-
LC 124 DFS with global max
Amazon · Google · Meta · Microsoft
-
LC 297 BFS/DFS encode-decode
Amazon · Google · Meta
-
LC 236 DFS LCA pattern
Amazon · Google · Meta · Microsoft
-
LC 98 DFS with min/max bounds
Amazon · Google · Meta · Microsoft
-
LC 230 Inorder traversal
Amazon · Google · Microsoft
-
LC 235 BST property shortcut
Amazon · Google · Microsoft
-
LC 103 BFS direction flag
Amazon · Google · Microsoft
-
LC 863 BFS with parent map
Amazon · Google · Meta
-
LC 114 Morris / recursive flatten
Amazon · Google · Meta
- Count Good Nodes in Binary Tree (opens in a new tab) medium · ★ extra
LC 1448 DFS pass max down
Amazon · Google
- Longest ZigZag Path in BT (opens in a new tab) medium · ★ extra
LC 1372 DFS direction state
Amazon · Google
- Path Sum III (opens in a new tab) medium · ★ extra
LC 437 DFS + prefix sum on tree
Amazon · Google · Meta
Heap / Priority Queue 11
-
LC 215 Min-heap of size k
Amazon · Google · Meta · Microsoft
-
LC 973 Max-heap / quick select
Amazon · Google · Meta
-
LC 253 Min-heap track end times
Amazon · Google · Meta · Microsoft
-
LC 295 Two heaps (max+min)
Amazon · Google · Meta · Microsoft
- Max Profit in Job Scheduling (opens in a new tab) hard · ★ extra
LC 1235 DP + binary search on events
Amazon · Google · Meta
- Min Interval to Include Each Query (opens in a new tab) hard · ★ extra
LC 1851 Sort + min-heap sweep line
Amazon · Google
- Kth Smallest in a Sorted Matrix (opens in a new tab) medium · ★ extra
LC 378 Min-heap / binary search
Amazon · Google · Microsoft
Backtracking 12
- Subsets (opens in a new tab) medium
LC 78 Pick / no-pick recursion
Amazon · Google · Meta · Microsoft
-
LC 17 Multi-branch DFS
Amazon · Google · Meta · Microsoft
-
LC 131 DFS + palindrome check
Amazon · Google · Apple
Trie 6
-
LC 208 Trie node structure
Amazon · Google · Meta · Microsoft
-
LC 211 Trie + DFS wildcard
Amazon · Google · Meta
- Search Suggestions System (opens in a new tab) medium · ★ extra
LC 1268 Trie / BS autocomplete
Amazon · Google
- Maximum XOR of Two Numbers (opens in a new tab) medium · ★ extra
LC 421 Trie for XOR matching
Amazon · Google
Graphs: BFS / DFS 12
-
LC 133 BFS/DFS with visited map
Amazon · Google · Meta · Microsoft
-
LC 200 DFS flood fill
Amazon · Google · Meta · Microsoft
-
LC 417 Reverse BFS from edges
Amazon · Google
-
LC 329 DFS + memoization on grid
Amazon · Google · Meta
- Surrounded Regions (opens in a new tab) medium · ★ extra
LC 130 Reverse DFS from border
Amazon · Google
- Number of Closed Islands (opens in a new tab) medium · ★ extra
LC 1254 DFS boundary awareness
Amazon · Google
- Making a Large Island (opens in a new tab) hard · ★ extra
LC 827 DFS island ID + merge
Amazon · Google
Graphs: Topological Sort 6
-
LC 207 Topo sort / cycle detect
Amazon · Google · Meta · Microsoft
-
LC 210 Topological sort order
Amazon · Google · Meta · Microsoft
-
LC 269 Topo sort on chars
Amazon · Google · Meta · Microsoft
- Sequence Reconstruction (opens in a new tab) medium · ★ extra
LC 444 Topo sort uniqueness check
Amazon · Google
- Parallel Courses (opens in a new tab) medium · ★ extra
LC 1136 Topo sort + level BFS
Amazon · Google
Graphs: Shortest Path 4
-
LC 787 Bellman-Ford / Dijkstra
Amazon · Google · Meta
- Path with Maximum Probability (opens in a new tab) medium · ★ extra
LC 1514 Dijkstra with max prob
Amazon · Google
- Shortest Path in Binary Matrix (opens in a new tab) medium · ★ extra
LC 1091 BFS on grid 8-direction
Amazon · Google · Meta
Union-Find 8
-
LC 323 Union-Find / DFS
Amazon · Google · Meta
-
LC 1192 Tarjan's bridge finding
Amazon · Google
- Number of Provinces (opens in a new tab) medium · ★ extra
LC 547 Union-Find / DFS classic
Amazon · Google
- Smallest String With Swaps (opens in a new tab) medium · ★ extra
LC 1202 Union-Find + sort groups
Amazon · Google
- Redundant Connection II (opens in a new tab) hard · ★ extra
LC 685 Union-Find on directed graph
Amazon · Google
Dynamic Programming: 1D 15
-
LC 322 Min coins unbounded knapsack
Amazon · Google · Meta · Microsoft
-
LC 518 Count ways unbounded knapsack
Amazon · Google · Meta
-
LC 300 DP / binary search O(nlogn)
Amazon · Google · Meta · Microsoft
-
LC 91 DP with constraints
Amazon · Google · Meta · Microsoft
-
LC 152 DP track min & max
Amazon · Google · Meta · Microsoft
-
LC 53 Kadane's algorithm
Amazon · Google · Meta · Microsoft
-
LC 416 0/1 knapsack DP
Amazon · Google · Apple
- Combination Sum IV (opens in a new tab) medium · ★ extra
LC 377 Unbounded knapsack count order
Amazon · Google
- Target Sum (opens in a new tab) medium · ★ extra
LC 494 DP / DFS + memoization
Amazon · Google · Meta
Dynamic Programming: 2D 13
-
LC 1143 2D DP LCS pattern
Amazon · Google · Meta · Microsoft
-
LC 10 2D DP with wildcard
Amazon · Google · Meta · Microsoft
-
LC 309 State machine DP
Amazon · Google
-
LC 188 DP with transaction count
Amazon · Google · Meta
- Interleaving String (opens in a new tab) medium · ★ extra
LC 97 2D DP string interleave
Amazon · Google · Meta
- Longest Palindromic Subsequence (opens in a new tab) medium · ★ extra
LC 516 2D DP palindrome
Amazon · Google
- Min Insertions to Make Palindrome (opens in a new tab) hard · ★ extra
LC 1312 2D DP = n - LPS
Amazon · Google
Greedy 10
-
LC 121 One-pass min track
Amazon · Google · Meta · Microsoft
-
LC 435 Greedy sort by end
Amazon · Google · Meta
- Min Arrows to Burst Balloons (opens in a new tab) medium · ★ extra
LC 452 Greedy interval cover
Amazon · Google
- Two City Scheduling (opens in a new tab) medium · ★ extra
LC 1029 Greedy sort by cost diff
Amazon · Google
Bit Manipulation 8
-
LC 191 Brian Kernighan / shift
Amazon · Google · Microsoft · Apple
-
LC 371 Bit add without operator
Amazon · Google · Meta
Math & Simulation 6
-
LC 384 Knuth / Fisher-Yates shuffle
Google · Meta · Microsoft
Design 9
-
LC 146 Doubly linked list + HashMap
Amazon · Google · Meta · Microsoft
-
LC 380 Array + HashMap swap trick
Amazon · Google · Meta · Microsoft
-
LC 341 Stack-based iterator
Amazon · Google · Meta
-
LC 1472 Doubly linked list / array
Amazon · Google
-
LC 622 Array with mod indexing
Amazon · Google · Microsoft
String 10
-
LC 5 Expand around center
Amazon · Google · Meta · Microsoft
-
LC 647 Count palindromes expand
Amazon · Google · Meta
-
LC 8 State machine parsing
Amazon · Google · Microsoft
-
LC 273 Chunked recursion
Amazon · Google · Microsoft
-
LC 443 Two pointer in-place
Amazon · Google · Meta · Microsoft
-
LC 28 KMP / built-in search
Amazon · Google · Microsoft
-
LC 1249 Stack index tracking
Amazon · Meta
- Longest Valid Parentheses (opens in a new tab) hard · ★ extra
LC 32 DP / stack span
Amazon · Google · Meta
Divide & Conquer / Sorting 6
-
LC 912 Merge sort / Quick sort impl
Amazon · Google · Microsoft
-
LC 315 Merge sort with index
Amazon · Google
-
LC 75 Dutch national flag / 3-way
Amazon · Google · Microsoft
No problems match these filters.