I have written some code to remove duplicates from Integer Array. I dont want to use any inbuilt keywords/property.
Here is my logic :
int[] iArray = {1,2,3,2,3,4,3};
int t = 0;
int arraysize = iArray.Length;
for (int m = 0; m < arraysize; m++)
{
if (iArray[m] != iArray[t])
{
t++;
iArray[t] = iArray[m];
}
}
arraysize = t + 1;
for (int m = 0; m < arraysize; m++)
{
Console.WriteLine(iArray[m]);
}
Output should be:
1,2,3,4
It does not give the desired output. Guys, this is not the homewok. This is Self Learning. No LINQ,Contains keyword please. Thank you for you replies.
Thanks.