Amazon Interview Question

Toughest problem you have solved with easy solution.