using namespace std;
You don’t need to put that condition
if(t<=40),that’s given in the problem to tell you which data type to use,suppose if it were 10^9,then you would have used long long int. So,just remove that if condition and then try it out.
You missed one letter, try the alphabet again
As @rishabhprsd7 said, you missed ‘Q’, so ran to WA.
Here is my solution, which is copy from you and added condition “if word[i] = ‘Q’ then count++”
-1: that condition is not wrong, is redundant, but it is not a problem, also 10 fits nicely in
Oops!,Thanks now i got that…