Pergunta de entrevista da empresa Capri Global Capital

How to find the 2nd largest/smallest element in an array