Amazon interview question

puzzle