Amazon interview question

reverse words