Let's say I have two dimensional array that represents simple matrix
int[,] matrix= new int[,] { { 1, 2 }, { 3, 4 }, { 1, 2 }, { 7, 8 } };
It looks like that
1 2
3 4
1 2
7 8
Is there any way to delete duplicate rows using LINQ and make array to look like this?
1 2
3 4
7 8
This is not really Linq, but you can define some helper method as if they were Linq methods.
The simpler algorithm should be:
This looks like this:
The custom List comparer (copied from a Jon Skeet's answer):
The usage :