Given the root of a binary tree, determine if it is a valid Binary Search Tree (BST).
A valid BST is defined as:
The tree is provided as a single JSON array representing level-order
traversal, where null indicates missing nodes.
Input:
[2,1,3]
Output: true
Input:
[5,1,4,null,null,3,6]
Output: false
In the second example, node 3 is in the right subtree of
5 but is smaller than 5, which violates BST rules.
Your program must print either true or false
exactly, so it can be compared with the expected output.
No submissions yet.
Discuss in-order traversal vs recursive min/max range validation approaches.