My issue
My code
// Update the code below to solve the problem
#include <stdio.h>
int main() {
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
int n,p,q;
scanf("%d", &n);
int A[n];
int count;
for (int j = 0; j < n; j++) {
scanf("%d", &A[j]);
}
for(int i=0;i<n;i++)
{
if(A[i]==(6*(i+1)+i))
{
p=p-1;
}
else if(A[i]==7*i)
{
q=q-1;
}
else
{
p=4;
q=4;
}
}
count=n+p+q;
printf("%d\n",count);
}
}
Learning course: C for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone