Infosys Interview Question

Collections question