Let\'s say I have two dimensional array that represents simple matrix
int[,] matrix= new int[,] { { 1, 2 }, { 3, 4 }, { 1, 2 }, { 7, 8 } };
int[,] list = new int[,] { { 1, 2 }, { 3, 4 }, { 1, 2 }, { 7, 8 } };
List> newList = new List>();
bool dupFound;
for (int i = 0; i < list.Length; i++)
{
dupFound = false;
for (int a = 0; a < list.Length; i++)
{
if ((i != a) && list[a, 0] == list[i, 0] && list[a, 1] == list[i, 1])
{
dupFound = true;
break;
}
}
if (!dupFound)
{
var nonDup = new KeyValuePair(list[i,0], list[i,1]);
newList.Add(nonDup);
}
}