Amazon Interview Question

Basic fix the Bug in the code problems