Here is the code. It's just deleting the half of duplicate elements from an array and others are to remain there. don't know what is the problem. need assistance thank you.
int[] count_list = { 10, 20, 10, 30, 30, 40, 20, 50, 90, 60, 80, 70, 80, 90 };
int l = count_list.Length;
for (int i = 0; i < l; i++)
{
for (int j =i + 1; j < l;)
{
if(count_list[j] == count_list[i]){
for (int k = j; k < l; k++)
{
count_list[k] = count_list[k + 1] ;
l--;
}
}
else{
j++;
}
}
}
for (int i = 0; i < count_list.Length; i++)
{
Console.WriteLine(count_list[i]);
// Console.WriteLine("name");
}