Amazon interview question

Coding at last