Amazon interview question

It was an online coding assessment.