Skip to content

Commit 7743794

Browse files
fixed condition to follow the algorithm design
1 parent 794f343 commit 7743794

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/0098-validate-binary-search-tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def isValidBST(self, root: TreeNode) -> bool:
99
def valid(node, left, right):
1010
if not node:
1111
return True
12-
if not (node.val < right and node.val > left):
12+
if not (left < node.val < right):
1313
return False
1414

1515
return valid(node.left, left, node.val) and valid(

0 commit comments

Comments
 (0)