Pregunta de entrevista de PwC

Searching largest and second largest elements in an array