mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 00:43:04 +08:00
Update 0112.路径总和.md
修改了一个错字。最近在准备 ACM 省赛,非常感谢作者的题解!
This commit is contained in:
@ -249,7 +249,7 @@ private:
|
||||
vector<int> path;
|
||||
// 递归函数不需要返回值,因为我们要遍历整个树
|
||||
void traversal(TreeNode* cur, int count) {
|
||||
if (!cur->left && !cur->right && count == 0) { // 遇到了叶子节点切找到了和为sum的路径
|
||||
if (!cur->left && !cur->right && count == 0) { // 遇到了叶子节点且找到了和为sum的路径
|
||||
result.push_back(path);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user