My solution seems correct but it's getting partially accepted

interview-questions
google
Tags: #<Tag:0x00007f24285eb070> #<Tag:0x00007f24285eaf30>

#1

Here is my solution:

int Solution::hammingDistance(const vector<int> &A) {
    int n=A.size(), count=0;
    for(int i=0; i<32; i++)
    { int c=0;
        for(int j=0; j<n; j++)
        {
            if(A[j]&(1<<i))
                c++;
        }
        count+= (c*(n-c)*2)%1000000007;
    }
    return count%1000000007;
}

#2

Change data type of n to long long int