Amazon interview question

Designing algorithm with the best possible time-complexity?