Validate Binary Search Tree
Given the root of a binary tree, determine if it is a valid binary search tree (BST).

30:00

Validate Binary Search Tree
medium
Topics
Companies

Given the root of a binary tree, determine if it is a valid binary search tree (BST).

Example 1:
Input: {"root":[5,1,4,null,null,3,6]}
Output: false
Constraints:
  • The number of nodes is in the range [1,104][1, 10^4].

  • 231Node.val2311-2^{31} \leq \text{Node.val} \leq 2^{31} - 1

Input
arr ={"root":[5,1,4,null,null,3,6]}

Checking node 5. Range: (-inf, inf)

5

1

4

3

6

Variables
No variables to display
DepthFunction Call
Stack empty
0/10