Uber interview question

Find if tree is a valid BST