LeetCode
LeetCode copied to clipboard
[算法] Backtracking algorithm
- [ ] 691. Stickers to Spell Word
- [x] 🟥🌟489. Robot Room Cleaner
- [ ] 🟨🌟301. Remove Invalid Parentheses
- [x] 20. Valid Parentheses [Stack]
- [x] 🟨🌟1963. Minimum Number of Swaps to Make the String Balanced [Stack]
- [ ] 140. Word Break II
- [ ] 139. Word Break
- [x] 🟨🌟17. Letter Combinations of a Phone Number
- [ ] 282. Expression Add Operators
- [x] ✅⭐78. Subsets [典型的Backtracking]
- Method 1. 选/不选;
- Method 2. 选哪一个元素
- [x] 90. Subsets II
- [x] 131. Palindrome Partitioning [选哪一个元素]
- [ ] 267. Palindrome Permutation II
- [ ] 113. Path Sum II [Tree+Backtracking]
- [ ] 112. Path Sum
- [x] 🟨🌟79. Word Search [Backtracking]
- [ ] 🟨🌟 212. Word Search II [Trie, Backtracking, Optimization]
- [x] 🟩🌟 22. Generate Parentheses
Combinations & Combination Sum
- [x] 77. Combinations
- [x] 39. Combination Sum
- [x] 40. Combination Sum II
- [x] 216. Combination Sum III
- [x] 377. Combination Sum IV
- Dynamic Programming
子集型回溯
对于子集型回溯问题,当处理当前元素的时候,可分为 选/不选 两种处理方式。另一种解法就是当需要选择第 idx 个元素时,该选择哪一个。
- Method 1. 选/不选;
- Method 2. 选哪一个元素 (我比较常用的)
子集型回溯问题
- [x] 17. Letter Combinations of a Phone Number
- [x] ✅⭐78. Subsets [典型的Backtracking]
- [x] 90. Subsets II
- [x] 131. Palindrome Partitioning [选哪一个元素]