I am getting wrong answer for the holes problem,can anyone tell me what am i doing wrong?
#include <stdio.h>
#include <string.h>
int main()
{
char a[100];
char *c;
int counter=0,t;
scanf("%d",&t);
while (t--) {
counter=0;
scanf("%s",a);
c=a;
const char *d={"ADOPQR"};
int two={66};
while (*c!='\0') {
if (memchr(c, two, sizeof(two))) {
counter=counter+2;
}
if (strchr(d, *c)) {
counter++;
}
c++;
}
printf("%d\n",counter);
}
return 0;
}