number = {5,3,5,5,5,6,6,9,3,3};
How do I get a unique number which is not duplicated in array?
What I want to get
9
My code is below
int[] list = {5,3,5,5,5,6,6,9,3,3};
Arrays.sort(list);
for(int i = 0; i < list.length; i++){
for(int j = i+1; j < list.length; j++){
if(list[i] == list[j]){
break;
}
}
}