```
int singleNumber(vector<int>& nums) {
int s[32] = {0}, ans = 0, i, j;
for (i = 0; i < nums.size(); i++) {
for (j = 0; j < 32; j++) {
s[j] += nums[i]&1;
nums[i] >>= 1;
}
}
for (i = 0; i < 32; i++)
if (s[i]%3)
ans += pow(2, i);
return ans;
}
int singleNumber(vector<int>& nums) {
int s[32] = {0}, ans = 0, i, j;
for (i = 0; i < nums.size(); i++)
for (j = 0; j < 32; j++) {
s[j] += nums[i]&1;
nums[i] >>= 1;
}
for (i = 31; i >= 0; i--)
if (s[i]%3)
ans += pow(2, i);
return ans;
}
```

The latter was accepted but the former not, why?