File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ leetcode 题解,记录自己的 leetcode 解题之路。
326
326
- [ 0454. 四数相加 II] ( ./problems/454.4-sum-ii.md )
327
327
- [ 0456. 132 模式] ( ./problems/456.132-pattern.md ) 🆕
328
328
- [ 0464. 我能赢么] ( ./problems/464.can-i-win.md )
329
- - [ 0473. 火柴拼正方形赢么 ] ( ./problems/473.matchsticks-to-square.md ) 🆕 👍
329
+ - [ 0473. 火柴拼正方形 ] ( ./problems/473.matchsticks-to-square.md ) 🆕 👍
330
330
- [ 0494. 目标和] ( ./problems/494.target-sum.md )
331
331
- [ 0516. 最长回文子序列] ( ./problems/516.longest-palindromic-subsequence.md )
332
332
- [ 0513. 找树左下角的值] ( ./problems/513.find-bottom-left-tree-value.md ) 91
Original file line number Diff line number Diff line change 186
186
- [ 0454. 四数相加 II] ( ./problems/454.4-sum-ii.md )
187
187
- [ 0456. 132 模式] ( ./problems/456.132-pattern.md ) 🆕 👍
188
188
- [ 0464. 我能赢么] ( ./problems/464.can-i-win.md ) 👍
189
- - [ 0473. 火柴拼正方形赢么 ] ( ./problems/473.matchsticks-to-square.md ) 🆕 👍
189
+ - [ 0473. 火柴拼正方形 ] ( ./problems/473.matchsticks-to-square.md ) 🆕 👍
190
190
- [ 0494. 目标和] ( ./problems/494.target-sum.md )
191
191
- [ 0516. 最长回文子序列] ( ./problems/516.longest-palindromic-subsequence.md )
192
192
- [ 0513. 找树左下角的值] ( ./problems/513.find-bottom-left-tree-value.md ) 91
Original file line number Diff line number Diff line change @@ -42,9 +42,11 @@ https://leetcode-cn.com/problems/matchsticks-to-square/
42
42
43
43
## 思路
44
44
45
- 题目规定了** 火柴数组的长度不超过 15** ,基本就可以锁定为回溯题目。为什么?不清楚的可以看下我写的 [ 这篇文章 ] ( https://lucifer.ren/blog/2020/12/21/shuati-silu3/ ) 。
45
+ 题目规定了** 火柴数组的长度不超过 15** ,基本就可以锁定为回溯题目。
46
46
47
- 这道题我们可以使用长度为 4 的 sides 数组存储已经排好的火柴的边的情况。显然,如果能找到一个令任意 sides[ i] 都等于 side 的组合就返回 True,否则返回 False。其中 side 为火柴长度总和的四分之一。
47
+ > 为什么?不清楚的可以看下我写的[ 这篇文章] ( https://lucifer.ren/blog/2020/12/21/shuati-silu3/ ) 。
48
+
49
+ 这道题我们可以使用长度为 4 的 sides 数组存储已经排好的火柴的边的情况。显然,如果能找到一个` 令任意 sides[i] 都等于 side ` 的组合就返回 True,否则返回 False。其中 side 为火柴长度总和的四分之一。
48
50
49
51
这提示我们使用回溯找到所有的 sides 的可行组合,从 sides[ 0] 开始枚举所有放置可能,接下来放置 sides[ 1] ...。
50
52
You can’t perform that action at this time.
0 commit comments