s0093
All checks were successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2023-02-02 18:13:48 +08:00
parent 19212e880b
commit 06929474ee
4 changed files with 78 additions and 2 deletions

View File

@@ -28,10 +28,15 @@ void backtrack(NodeState &node, vector<NodeState> &result, int para1, int para2,
return;
}
// 剪枝
// 当现在的节点不可能出现我们想要的结果时,直接跳过。
if (/* out of scope */) {
return;
}
// 遍历该节点的所有子节点,即遍历下一层
for (...) {
// 剪枝
// 当现在的节点不可能出现我们想要的结果时,直接跳过。
// 剪枝也可以在 for 循环中完成
if (/* out of scope */) {
continue;
}

View File

@@ -3,3 +3,5 @@
## [131. 分割回文串](https://leetcode.cn/problems/palindrome-partitioning/)
![](https://paste.sainnhe.dev/FHTE.jpg)
## [93. 复原 IP 地址](https://leetcode.cn/problems/restore-ip-addresses/)