 # Why is the test case I'm failing not visible?

#1

My previous submissions earned me partial marks. But after changing the code, when I’m submitting I get wrong answer. But I can’t see which test case I’m failing.

Here is my code btw. Please point out my mistake

``````    int Solution::seats(string A) {
int stlen = A.length();
vector <int> seatedPos;

for (int i=0; i<stlen; i++) {
if (A[i]=='x')
seatedPos.push_back (i);
}

if (seatedPos.empty())
return 0;

int mPos =  seatedPos[seatedPos.size()/2];
int j=mPos-1, jump=0;

//cout<<mPos;

for (int i=mPos-1; i>=0; i--) {
if (A[i]=='x') {
jump+= abs(i-j);
j--;
}
}

j=mPos+1;
for (int i=mPos+1; i<stlen; i++) {
if (A[i]=='x') {
jump+= abs(j-i);
j++;
}
}

return jump%10000003;
}``````

#2

Use long long instead of int it will pass

#3

Thank you! Can’t believe I spent more than an hour on this!

#4

Nope. For me the submission does not pass, not even with long long. What is even weirder is that if I use size_t instead of long long the initial tests will fail ??!

#5

use modulo arithmetric in the if cases too instead of just applying mod at the end…
#define mod 100000003
jump = (jump%mod + abs(j-i)%mod)%mod;