Microsoft interview question

BST tree + greedy algorithm