

Given the root of a binary tree, return True if it is a valid Binary Search Tree (BST), otherwise return False.
A valid BST requires that every node in the left subtree is strictly less than the current node, every node in the right subtree is strictly greater than the current node, and both subtrees must also be valid BSTs.
Example 1:
Input: root = [2,1,3]
Output: true
Explanation: The left child is smaller than 2 and the right child is greater than 2.
Example 2:
Input: root = [5,1,4,null,null,3,6]
Output: false
Explanation: The node 3 is in the right subtree of 5 but is smaller than 5, so the tree is not a valid BST.
[0, 10^4]-2^31 <= Node.val <= 2^31 - 1Given the root of a binary tree, return True if it is a valid Binary Search Tree (BST), otherwise return False.
A valid BST requires that every node in the left subtree is strictly less than the current node, every node in the right subtree is strictly greater than the current node, and both subtrees must also be valid BSTs.
Example 1:
Input: root = [2,1,3]
Output: true
Explanation: The left child is smaller than 2 and the right child is greater than 2.
Example 2:
Input: root = [5,1,4,null,null,3,6]
Output: false
Explanation: The node 3 is in the right subtree of 5 but is smaller than 5, so the tree is not a valid BST.
[0, 10^4]-2^31 <= Node.val <= 2^31 - 1