Skip to content

Commit

Permalink
Merge pull request soapyigu#291 from maligh/patch-2
Browse files Browse the repository at this point in the history
Update PathSum.swift
  • Loading branch information
soapyigu authored May 11, 2020
2 parents dfe2b8a + e713133 commit 77b7fcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tree/PathSum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

class PathSum {
func hasPathSum(root: TreeNode?, _ sum: Int) -> Bool {
func hasPathSum(_ root: TreeNode?, _ sum: Int) -> Bool {
guard let root = root else {
return false
}
Expand All @@ -27,4 +27,4 @@ class PathSum {

return hasPathSum(root.left, sum - root.val) || hasPathSum(root.right, sum - root.val)
}
}
}

0 comments on commit 77b7fcc

Please sign in to comment.