Amazon interview question

Algorithm questions, fiding the bugs in the code (array)