Pergunta de entrevista da empresa PwC

Searching largest and second largest elements in an array