Amazon interview question

Debug multiple code snippets