SpanIdea interview question

They asked me to find second largest element.