LinkedIn interview question

Two sum Problem and check if it is a BST