摘要: 216. 组合总和 III 详解 class Solution { public: vector<vector<int>> result; vector<int> path; int sum = 0; void dfs(int k, int n, int start){ if(path.size() 阅读全文
posted @ 2023-09-07 16:37 zqh2023 阅读(164) 评论(0) 推荐(0)
摘要: 回溯算法理论基础 77. 组合 class Solution { public: vector<vector<int>> result; vector<int> path; void dfs(int n, int k, int start){ if(path.size() == k){ result 阅读全文
posted @ 2023-09-07 16:25 zqh2023 阅读(165) 评论(0) 推荐(0)
摘要: 669. 修剪二叉搜索树 详解 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), le 阅读全文
posted @ 2023-09-07 13:42 zqh2023 阅读(170) 评论(0) 推荐(0)