Lanvera Interview Question

For loop logic using if conditions