Microsoft Interview Question

BST tree + greedy algorithm