Skip to content

Commit

Permalink
Update PathSum.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
maligh authored Mar 6, 2020
1 parent 3ac8b91 commit e713133
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 e713133

Please sign in to comment.