Amazon interview question

Questions on algorithms and puzzles