|
1 | 1 | ---
|
2 |
| -title: Backtracking |
| 2 | +title: 2.08 ✅ Backtracking |
3 | 3 | type: docs
|
| 4 | +weight: 8 |
4 | 5 | ---
|
5 | 6 |
|
6 | 7 | # Backtracking
|
@@ -99,45 +100,44 @@ func updateMatrix_BFS(matrix [][]int) [][]int {
|
99 | 100 |
|
100 | 101 | | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance |
|
101 | 102 | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: |
|
102 |
| -|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||48.8%| |
103 |
| -|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||64.9%| |
104 |
| -|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|46.1%| |
105 |
| -|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||58.9%| |
106 |
| -|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||49.9%| |
107 |
| -|0046|Permutations|[Go]({{< relref "/ChapterFour/0046.Permutations.md" >}})|Medium| O(n)| O(n)|❤️|66.2%| |
108 |
| -|0047|Permutations II|[Go]({{< relref "/ChapterFour/0047.Permutations-II.md" >}})|Medium| O(n^2)| O(n)|❤️|49.1%| |
109 |
| -|0051|N-Queens|[Go]({{< relref "/ChapterFour/0051.N-Queens.md" >}})|Hard| O(n!)| O(n)|❤️|49.2%| |
110 |
| -|0052|N-Queens II|[Go]({{< relref "/ChapterFour/0052.N-Queens-II.md" >}})|Hard| O(n!)| O(n)|❤️|59.8%| |
111 |
| -|0060|Permutation Sequence|[Go]({{< relref "/ChapterFour/0060.Permutation-Sequence.md" >}})|Hard| O(n log n)| O(1)||39.2%| |
112 |
| -|0077|Combinations|[Go]({{< relref "/ChapterFour/0077.Combinations.md" >}})|Medium| O(n)| O(n)|❤️|57.1%| |
113 |
| -|0078|Subsets|[Go]({{< relref "/ChapterFour/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|64.6%| |
114 |
| -|0079|Word Search|[Go]({{< relref "/ChapterFour/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|36.6%| |
115 |
| -|0089|Gray Code|[Go]({{< relref "/ChapterFour/0089.Gray-Code.md" >}})|Medium| O(n)| O(1)||50.1%| |
116 |
| -|0090|Subsets II|[Go]({{< relref "/ChapterFour/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|48.6%| |
117 |
| -|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|37.3%| |
118 |
| -|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.5%| |
119 |
| -|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0131.Palindrome-Partitioning.md" >}})|Medium| O(n)| O(n^2)|❤️|51.5%| |
120 |
| -|0211|Design Add and Search Words Data Structure|[Go]({{< relref "/ChapterFour/0211.Design-Add-and-Search-Words-Data-Structure.md" >}})|Medium| O(n)| O(n)|❤️|39.9%| |
121 |
| -|0212|Word Search II|[Go]({{< relref "/ChapterFour/0212.Word-Search-II.md" >}})|Hard| O(n^2)| O(n^2)|❤️|36.7%| |
122 |
| -|0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|60.0%| |
123 |
| -|0306|Additive Number|[Go]({{< relref "/ChapterFour/0306.Additive-Number.md" >}})|Medium| O(n^2)| O(1)|❤️|29.6%| |
124 |
| -|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.8%| |
125 |
| -|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||48.3%| |
126 |
| -|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0526.Beautiful-Arrangement.md" >}})|Medium| O(n^2)| O(1)|❤️|61.7%| |
127 |
| -|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(n)||66.3%| |
128 |
| -|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|36.7%| |
129 |
| -|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||77.2%| |
130 |
| -|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||48.0%| |
131 |
| -|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1079.Letter-Tile-Possibilities.md" >}})|Medium| O(n^2)| O(1)|❤️|75.8%| |
132 |
| -|1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||77.3%| |
133 |
| -|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.5%| |
134 |
| -|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.3%| |
135 |
| -|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1681.Minimum-Incompatibility.md" >}})|Hard||||35.2%| |
136 |
| -|1688|Count of Matches in Tournament|[Go]({{< relref "/ChapterFour/1688.Count-of-Matches-in-Tournament.md" >}})|Easy||||83.0%| |
| 103 | +|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0000~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||48.8%| |
| 104 | +|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0000~0099/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||64.9%| |
| 105 | +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0000~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|46.1%| |
| 106 | +|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0000~0099/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||58.9%| |
| 107 | +|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0000~0099/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||49.9%| |
| 108 | +|0046|Permutations|[Go]({{< relref "/ChapterFour/0000~0099/0046.Permutations.md" >}})|Medium| O(n)| O(n)|❤️|66.2%| |
| 109 | +|0047|Permutations II|[Go]({{< relref "/ChapterFour/0000~0099/0047.Permutations-II.md" >}})|Medium| O(n^2)| O(n)|❤️|49.1%| |
| 110 | +|0051|N-Queens|[Go]({{< relref "/ChapterFour/0000~0099/0051.N-Queens.md" >}})|Hard| O(n!)| O(n)|❤️|49.2%| |
| 111 | +|0052|N-Queens II|[Go]({{< relref "/ChapterFour/0000~0099/0052.N-Queens-II.md" >}})|Hard| O(n!)| O(n)|❤️|59.8%| |
| 112 | +|0060|Permutation Sequence|[Go]({{< relref "/ChapterFour/0000~0099/0060.Permutation-Sequence.md" >}})|Hard| O(n log n)| O(1)||39.3%| |
| 113 | +|0077|Combinations|[Go]({{< relref "/ChapterFour/0000~0099/0077.Combinations.md" >}})|Medium| O(n)| O(n)|❤️|57.1%| |
| 114 | +|0078|Subsets|[Go]({{< relref "/ChapterFour/0000~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|64.7%| |
| 115 | +|0079|Word Search|[Go]({{< relref "/ChapterFour/0000~0099/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|36.6%| |
| 116 | +|0089|Gray Code|[Go]({{< relref "/ChapterFour/0000~0099/0089.Gray-Code.md" >}})|Medium| O(n)| O(1)||50.2%| |
| 117 | +|0090|Subsets II|[Go]({{< relref "/ChapterFour/0000~0099/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|48.6%| |
| 118 | +|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0000~0099/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|37.3%| |
| 119 | +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.5%| |
| 120 | +|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium| O(n)| O(n^2)|❤️|51.5%| |
| 121 | +|0211|Design Add and Search Words Data Structure|[Go]({{< relref "/ChapterFour/0200~0299/0211.Design-Add-and-Search-Words-Data-Structure.md" >}})|Medium| O(n)| O(n)|❤️|39.9%| |
| 122 | +|0212|Word Search II|[Go]({{< relref "/ChapterFour/0200~0299/0212.Word-Search-II.md" >}})|Hard| O(n^2)| O(n^2)|❤️|36.7%| |
| 123 | +|0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0200~0299/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|60.0%| |
| 124 | +|0306|Additive Number|[Go]({{< relref "/ChapterFour/0300~0399/0306.Additive-Number.md" >}})|Medium| O(n^2)| O(1)|❤️|29.6%| |
| 125 | +|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.8%| |
| 126 | +|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0400~0499/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||48.3%| |
| 127 | +|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium| O(n^2)| O(1)|❤️|61.7%| |
| 128 | +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(n)||66.3%| |
| 129 | +|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|36.7%| |
| 130 | +|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||77.2%| |
| 131 | +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||48.1%| |
| 132 | +|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1000~1099/1079.Letter-Tile-Possibilities.md" >}})|Medium| O(n^2)| O(1)|❤️|75.8%| |
| 133 | +|1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||77.2%| |
| 134 | +|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.4%| |
| 135 | +|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.3%| |
| 136 | +|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||35.2%| |
| 137 | +|1688|Count of Matches in Tournament|[Go]({{< relref "/ChapterFour/1600~1699/1688.Count-of-Matches-in-Tournament.md" >}})|Easy||||82.9%| |
137 | 138 | |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------|
|
138 | 139 |
|
139 | 140 |
|
140 |
| - |
141 | 141 | ----------------------------------------------
|
142 | 142 | <div style="display: flex;justify-content: space-between;align-items: center;">
|
143 | 143 | <p><a href="https://books.halfrost.com/leetcode/ChapterTwo/Dynamic_Programming/">⬅️上一页</a></p>
|
|
0 commit comments