Amazon interview question

to answer a programming problem