Amazon interview question

algorithm and coding in any language of choice