Amazon interview question

LC medium based on BST