Skip to content

Commit cf9dc5b

Browse files
Sean PrashadSean Prashad
authored andcommitted
Update 112_Path_Sum.java
1 parent 3a57aa9 commit cf9dc5b

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Tree Depth First Search/112_Path_Sum.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ public boolean hasPathSum(TreeNode root, int sum) {
33
if (root == null) {
44
return false;
55
}
6-
76
if (root.left == null && root.right == null && sum - root.val == 0) {
87
return true;
98
}
10-
119
return hasPathSum(root.left, sum - root.val) || hasPathSum(root.right, sum - root.val);
1210
}
1311
}

0 commit comments

Comments
 (0)