Amazon interview question

Identify the bug in this piece of code.

Interview Answer

Anonymous

18 Feb 2024

Found the bug and gave the solution.