Amazon interview question

Couldn't clear the initial rounds.