Infosys Interview Question

english was quite lengthy