Given the root of a binary tree, determine if it's a valid binary search tree (BST).
A binary search tree is valid if:
Constraints:
Examples:
// Example 1: // 2 // / \ // 1 3 const root1 = createTree([2, 1, 3]); console.log(isValidBST(root1)); // Output: true // Example 2: // 1 // / \ // 2 3 const root2 = createTree([1, 2, 3]); console.log(isValidBST(root2)); // Output: false // Explanation: Left child (2) is greater than root (1)