Help me in solving CS2023_STK problem

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

@basalt802
plzz refer the following solution

#include <stdio.h>

int main(void) {
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n;
        scanf("%d",&n);
        int om[n],addy[n],omtemp=0,ommax=0,adtemp=0,admax=0;
       for(int i=0;i<n;i++)
       {
            scanf("%d",&om[i]);
            if(om[i]>0)
            {
                  omtemp++;
                if(omtemp>ommax) 
                   ommax=omtemp;
            }
            else omtemp=0;
        }
             
              
        for(int i=0;i<n;i++)
        {
            scanf("%d",&addy[i]);
              if(addy[i]>0)
              {
                  adtemp++;
                 if(adtemp>admax) 
                   admax=adtemp;
                  
               }
             else adtemp=0;
        }
             
    
             if(ommax>admax) printf("Om\n");
             else if(admax>ommax) printf("Addy\n");
             else printf("Draw\n");
    }

	return 0;
}