Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7743794

Browse files
fixed condition to follow the algorithm design
1 parent794f343 commit7743794

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
defvalid(node,left,right):
1010
ifnotnode:
1111
returnTrue
12-
ifnot (node.val<rightandnode.val>left):
12+
ifnot (left<node.val<right):
1313
returnFalse
1414

1515
returnvalid(node.left,left,node.val)andvalid(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp