ABC Interview Question

Program logic based on the array