Skip to content

Commit 39adf35

Browse files
committed
Merge branch 'master' of github.com:soapyigu/LeetCode_Swift
2 parents 40b3812 + 878ea3a commit 39adf35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tree/ValidateBinarySearchTree.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ class ValidateBinarySearchTree {
2121
return _helper(root, nil, nil)
2222
}
2323

24-
private func _helper(node: TreeNode?, _ min: Int?, _ max: Int?) -> Bool {
24+
private func _helper(_ node: TreeNode?, _ min: Int?, _ max: Int?) -> Bool {
2525
guard let node = node else {
2626
return true
2727
}
2828

29-
if let min = min, root.val <= min {
29+
if let min = min, node.val <= min {
3030
return false
3131
}
32-
if let max = max, root.val >= max {
32+
if let max = max, node.val >= max {
3333
return false
3434
}
3535

0 commit comments

Comments
 (0)