Accepted answer

You can't do this very easily in plain LINQ to Objects, unfortunately. You could find the minimum value and then find the Coord which has that value, but obviously that means going over the data twice.

I have a MinBy method in MoreLINQ which you could use though:

Coord minCoord = myCoords.MinBy(c => myArray[c.Row, c.Col]);


Another less than elegant answer:

coords.Single( x => array[x.Row, x.Col] == coords.Min(y => array[y.Row,y.Col]));

Related Articles