Assuming the "difficulty" is the second item in the array:
IEnumerable<String[]> scoresDesc =
list.OrderByDescending(ld => lineData[0])
.Where(ld => lineData[1] == 1);
You can sort it afterwards, but Where
returns an IEnumerable<T>
, not an IOrderedEnumerable<T>
, so if you need it to be an IOrderedEnumerable<T>
then it's cleaner (and faster) to filter the list first:
IOrderedEnumerable<String[]> scoresDesc =
list.Where(ld => lineData[1] == 1)
.OrderByDescending(ld => lineData[0]);
(this is where var
eases some pain, since you aren't bound to the return type)