O(nlog(n)) also got accepted


#1

int Solution::singleNumber(const vector &A)
{
vector temp = (vector)&A;

sort(temp->begin(),temp->end());

for(int x=0; x<A.size(); x+=2)
{   
    if(x==A.size()-1)
    {
        return A[x];
    }
    
    if(A[x] != A[x+1])
    {
        return A[x];
    }
}

}