My issue
it seems to work correctly
where is the problem
My code
#include <stdio.h>
int check(int a[],int b){
int temp=0,count=0;
for (int i=0;i<b;i++){
if(a[i]>0){
temp++;
}
else{
if(count<temp){
count=temp;
temp=0;
}
else{
temp=0;
}
}
}
return count;
}
int main(void) {
int X;
scanf("%d",&X);
while(X--){
int n;
scanf("%d",&n);
int a[n],b[n];
for (int i=0;i<n;i++){
scanf("%d",&a[i]);
}
for (int i=0;i<n;i++){
scanf("%d",&b[i]);
}
int c,d;
c=check(a,n);
d=check(b,n);
if (c>d){
printf("Om\n") ;
}
else if(d>c){
printf("Addy\n") ;
}
else{
printf("Draw\n");
}
}
return 0;
}
Problem Link: CodeChef Streak Practice Coding Problem - CodeChef