Pergunta de entrevista da empresa AppFolio

Find the index of the second largest element in the array.