Amazon Interview Question

Online exam had basic questions like find error in this code (for loop error, etc)