Amazon interview question

Validate the BST