How to get the second highest number in an array in Visual C#?

algorithm, arrays, c#

Solution

Try this (using LINQ):

int secondHighest = (from number in numbers
                     orderby number descending
                     select number).Skip(1).First();

Problem

I have an array of ints. I want to get the second highest number in that array. Is there an easy way to do this?

Original source

Related problems