I am using the below code to solve the HOLES in the TEXT problem, I am getting the expected o/p, but Its is not accepting the answer, I have checked the other solutions also they have the same logic as mine, But I don’t know why my solution is not being accepted.
Please help me out here
This is my code which i have used
#include<stdio.h>
int main(void)
{
int test;
scanf("%d",&test);
while(test--)
{
char str[100];
int holes=0;
scanf("%s",str);
int i;
for(i=0;str[i]!='\0';++i)
{
if(str[i]=='A'||str[i]=='D'||str[i]=='O'||str[i]=='P'||str[i]=='R'||str[i]=='Q')
++holes;
if(str[i]=='B')
holes=holes+2;
}
printf("%d",holes);
}
}