+ 8
How are duplicates removed from an array without using any library?
Duplicates in java
3 Answers
+ 5
Int a[]={3,5,8,8};
For(int I=0;I<a.lenght;I++)
{
For(int j=a.lenght;j>i;j--)
{
If(a[I].equals(a[j]))
{
flag=1
}
else{
K++;
a[K]=a[I];
}
}
if(flag!=1)
{
System.out.print(a[k]);
}
}
that is perfect
+ 3
You can use temporary array