Please help me in finding out Error in my code


#1

Can anyone tell me that why i am getting : -
Input : “DTNGJPURFHYE”
Output : 4201471016211868255943192
This is the output which i am getting corresponding to the input given above.
Though I have applied modulus in my code, still i am getting output greater than “10000003” i.e. Mod factor. Why is it happening ? What is the error in my code ? Thanks in advance.
Please find my code below:

#define MOD 1000003
int Solution::findRank(string A) {
char val = ‘a’;
if(isupper(A[0]))
{
val = ‘A’;
}
vector ch;
for(int i=0;i<A.length();i++)
{

    ch.push_back((A[i]-val) +1);
   // cout << ch[i];
}
int count =1;
int n = ch.size();
while(prev_permutation(ch.begin(),ch.end()))
{
    count = ((count % MOD )+ (1 % MOD) ) % MOD;
  //  cout << count ;
    
}
return count;

}