Amazon interview question

Correct some bug in the first OA, write code in second OA