Skip to content

Commit b269670

Browse files
refactor 538
1 parent b4e6ab7 commit b269670

File tree

1 file changed

+2
-4
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-4
lines changed

src/main/java/com/fishercoder/solutions/_538.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ private int dfs(TreeNode root, int val) {
4141
if (root == null) {
4242
return val;
4343
}
44-
int right = dfs(root.right, val);
45-
root.val += right;
46-
int left = dfs(root.left, root.val);
47-
return left;
44+
root.val += dfs(root.right, val);
45+
return dfs(root.left, root.val);
4846
}
4947
}
5048

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy