Without using bits c++ solution


#1

int Solution::singleNumber(const vector &A) {
vectorB =A;
int n=A.size();
sort(B.begin(),B.end());
int a;
int i=0;
while(i<n){
if(B[i]==B[i+1]){
i=i+3;
}
else{
a=B[i];
break;
}
}
return a;
}