Infosys Interview Question

Find the first and second maximum of an array in one loop