My issue
// Update the code below to solve the problem
include <stdio.h>
int main() {
int t,sum=8,i,j;
scanf(“%d”, &t);
for (int i = 0; i < t; i++) {
int n;
scanf(“%d”, &n);
int A[n];
for (int j = 0; j < n; j++) {
scanf(“%d”, &A[j]);
}
int sat[4]={6,13,20,27};
int sun[4]={7,14,21,28};
for(i=0;i<4;i++){
for(j=0;j<n;j++){
if(sat[i]!=A[j]&&sun[i]!=A[j])
sum++;
}
}
printf(“%d\n”,sum);
}
}
what is the error
My code
// Update the code below to solve the problem
#include <stdio.h>
int main() {
int t,sum=8,i,j;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
int n;
scanf("%d", &n);
int A[n];
for (int j = 0; j < n; j++) {
scanf("%d", &A[j]);
}
int sat[4]={6,13,20,27};
int sun[4]={7,14,21,28};
for(i=0;i<4;i++){
for(j=0;j<n;j++){
if(sat[i]!=A[j]&&sun[i]!=A[j])
sum++;
}
}
printf("%d\n",sum);
}
}
Learning course: C for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone