Amazon interview question

Code debugging and Logical reasoning Coding