本期讲了【组合型回溯】,包含【剪枝】技巧,以及分析回溯时间复杂度的通用技巧。欢迎一键三连!
涉及到的力扣题目+代码:
77. 组合 https://leetcode.cn/problems/combinations/solutions/2071017/hui-su-bu-hui-xie-tao-lu-zai-ci-pythonja-65lh/
216. 组合总和 III https://leetcode.cn/problems/combination-sum-iii/solutions/2071013/hui-su-bu-hui-xie-tao-lu-zai-ci-pythonja-feme/
22. 括号生成 https://leetcode.cn/problems/generate-parentheses/solutions/2071015/hui-su-bu-hui-xie-tao-lu-zai-ci-pythonja-wcdw/
课后作业:
按照视频中的要求,用另一种写法完成上面三题。
301. 删除无效的括号 https://leetcode.cn/problems/remove-invalid-parentheses/
39. 组合总和 https://leetcode.cn/problems/combination-sum/
题解:
39. 组合总和 https://leetcode.cn/problems/combination-sum/solution/liang-chong-fang-fa-xuan-huo-bu-xuan-mei-mhf9/
所有题目+题解汇总:
https://github.com/EndlessCheng/codeforces-go/blob/master/leetcode/README.md