Capital One interview question

Validate a BST