Skip to content

Commit

Permalink
Update problems/98.validate-binary-search-tree.md
Browse files Browse the repository at this point in the history
Co-Authored-By: lucifer <[email protected]>
  • Loading branch information
TH-coder and azl397985856 authored Apr 1, 2020
1 parent 7a65b28 commit b8a7689
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/98.validate-binary-search-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function valid(root,min = -Infinity,max=Infinity){
const val = root.val;
if(val<=min)return false;
if(val>=max)return false;
return valid(root.left,min,Math.min(val,max))&&valid(root.right,Math.max(val,min),max)
return valid(root.left,min,val)&&valid(root.right,val,max)
}
```

Expand Down

0 comments on commit b8a7689

Please sign in to comment.