Amazon interview question

First was the numerical test