Pergunta de entrevista da empresa SquareBoat

Write code to find the largest element and second largest element in the given array.