Skip to content

Commit

Permalink
Fix typo & Update Swift syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Binlogo committed Mar 6, 2019
1 parent 2a9f404 commit 0fdef5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tree/ValidateBinarySearchTree.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class ValidateBinarySearchTree {
return _helper(root, nil, nil)
}

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

if let min = min, root.val <= min {
if let min = min, node.val <= min {
return false
}
if let max = max, root.val >= max {
if let max = max, node.val >= max {
return false
}

Expand Down

0 comments on commit 0fdef5e

Please sign in to comment.