108 LeetCode Backtracking Problems - Categorized by Patterns
1. Subsets / Subsequences
Generate all possible subsets or subsequences (with/without duplicates).
- 78. Subsets (https://leetcode.com/problems/subsets/)
- 90. Subsets II (https://leetcode.com/problems/subsets-ii/) (Duplicates)
- 491. Non-decreasing Subsequences
(https://leetcode.com/problems/non-decreasing-subsequences/)
- 320. Generalized Abbreviation (https://leetcode.com/problems/generalized-abbreviation/)
- 1982. Find Array Given Subset Sums
(https://leetcode.com/problems/find-array-given-subset-sums/) (Hard)
2. Permutations
Generate all permutations (order matters, with/without duplicates).
- 46. Permutations (https://leetcode.com/problems/permutations/)
- 47. Permutations II (https://leetcode.com/problems/permutations-ii/) (Duplicates)
- 784. Letter Case Permutation (https://leetcode.com/problems/letter-case-permutation/)
- 996. Number of Squareful Arrays (https://leetcode.com/problems/number-of-squareful-arrays/)
- 267. Palindrome Permutation II (https://leetcode.com/problems/palindrome-permutation-ii/)
3. Combinations / Combination Sum
Find combinations that sum to a target (reuse allowed/not allowed).
- 39. Combination Sum (https://leetcode.com/problems/combination-sum/) (Reuse)
- 40. Combination Sum II (https://leetcode.com/problems/combination-sum-ii/) (No reuse, duplicates)
- 216. Combination Sum III (https://leetcode.com/problems/combination-sum-iii/) (k numbers sum to
n)
- 377. Combination Sum IV (https://leetcode.com/problems/combination-sum-iv/) (DP + BT)
- 77. Combinations (https://leetcode.com/problems/combinations/) (n choose k)
- 254. Factor Combinations (https://leetcode.com/problems/factor-combinations/)
4. N-Queens & Chessboard Problems
Classic backtracking puzzles.
- 51. N-Queens (https://leetcode.com/problems/n-queens/)
- 52. N-Queens II (https://leetcode.com/problems/n-queens-ii/)
- 1222. Queens That Can Attack the King
(https://leetcode.com/problems/queens-that-can-attack-the-king/)
5. Palindrome Partitioning
Split strings into palindromic substrings.
- 131. Palindrome Partitioning (https://leetcode.com/problems/palindrome-partitioning/)
- 132. Palindrome Partitioning II (https://leetcode.com/problems/palindrome-partitioning-ii/) (DP
Optimized)
6. Word Search / Boggle-like Problems
Find words in a grid or construct words.
- 79. Word Search (https://leetcode.com/problems/word-search/)
- 212. Word Search II (https://leetcode.com/problems/word-search-ii/) (Trie + BT)
- 980. Unique Paths III (https://leetcode.com/problems/unique-paths-iii/) (Grid traversal)
7. Generate Parentheses / Bracket Combinations
Construct valid parentheses combinations.
- 22. Generate Parentheses (https://leetcode.com/problems/generate-parentheses/)
- 301. Remove Invalid Parentheses (https://leetcode.com/problems/remove-invalid-parentheses/)
8. Sudoku Solver
Fill valid numbers in Sudoku grids.
- 37. Sudoku Solver (https://leetcode.com/problems/sudoku-solver/)
- 36. Valid Sudoku (https://leetcode.com/problems/valid-sudoku/) (Validation)
9. Phone Number Letter Combinations
Map digits to letters.
- 17. Letter Combinations of a Phone Number
(https://leetcode.com/problems/letter-combinations-of-a-phone-number/)
10. Maze / Robot Path Problems
Navigate grids with obstacles.
- 980. Unique Paths III (https://leetcode.com/problems/unique-paths-iii/)
- 1219. Path with Maximum Gold (https://leetcode.com/problems/path-with-maximum-gold/)
11. IP Address / String Segmentation
Split strings into valid segments.
- 93. Restore IP Addresses (https://leetcode.com/problems/restore-ip-addresses/)
12. Word Pattern / String Matching
Match strings based on patterns.
- 291. Word Pattern II (https://leetcode.com/problems/word-pattern-ii/)
13. Beautiful Arrangement / Special Permutations
Permutations with constraints.
- 526. Beautiful Arrangement (https://leetcode.com/problems/beautiful-arrangement/)
14. Letter Tile Possibilities / Count Unique Sequences
Count distinct sequences.
- 1079. Letter Tile Possibilities (https://leetcode.com/problems/letter-tile-possibilities/)
15. Other Classic Backtracking
- 401. Binary Watch (https://leetcode.com/problems/binary-watch/)
- 1087. Brace Expansion (https://leetcode.com/problems/brace-expansion/)
- 1239. Maximum Length of a Concatenated String with Unique Characters
(https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters/)