Amazon interview question

Nothing too complicated