Feedback for CS2023_STK problem

Problem Link: CS2023_STK Problem - CodeChef

Feedback

MY CODE IS PROPERLY GIVING ANSWERS ON MY VS CODE BUT IT IS PRODUCING REVERSE ANS IN YOUR IDE
include <bits/stdc++.h>
using namespace std;
int maxi(int ar[],int n)
{
int max = ar[0];
for(int i =0 ;i<n ;i++)
{
if(max<ar[i])
{
max =ar[i];

    }
}
return max;

}
int main() {
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
int om[n] = {0};
int andy[n] = {0};
for(int i=0;i<n;i++)
{
cin>>om[i];
}

    for(int i=0;i<n;i++)
    {
        cin>>andy[i];
    }
    int o = 0;
    int a = 0;
    int count_om [n]={0};
    int count_andy [n] = {0};
    for(int i =0 ;i <n ;i++)
    {
        if(om[i]==0)
        {
            count_om[o]=0;
            o++;
        }
        else
        count_om[o]++;
    }
    for(int i =0 ;i <n ;i++)
    {
        if(andy[i]==0)
        {
            count_andy[a] = 0;
            a++;
        }
        else
        count_andy[a]++;
    }
if(maxi(count_andy,n)>maxi(count_om,n))
{
    cout<<"ADDY"<<endl;
}
else if(maxi(count_andy,n)<maxi(count_om,n))
{
    cout<<"OM"<<endl;
}
else
{
    cout<<"DRAW"<<endl;
}
   
    
    
    
}


return 0;

}

@ashwinrai123
there is nothing wrong with the ide instead your logic has a minute mistake.
i have corrected it it was in the loop when om[i]==0 and andy[i]==0;
this is your corrected code
include <bits/stdc++.h>
using namespace std;
int maxi(int ar[],int n)
{
int max = ar[0];
for(int i =0 ;i<n ;i++)
{
if(max<ar[i])
{
max =ar[i];

    }
}
return max;

}
int main() {
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
int om[n] = {0};
int andy[n] = {0};
for(int i=0;i<n;i++)
{
cin>>om[i];
}

    for(int i=0;i<n;i++)
    {
        cin>>andy[i];
    }
    int o = 0;
    int a = 0;
    int count_om [n]={0};
    int count_andy [n] = {0};
    for(int i =0 ;i <n ;i++)
    {
        if(om[i]==0)
        {
            count_om[o+1]=0;
            o++;
        }
        else
        count_om[o]++;
    }
    for(int i =0 ;i <n ;i++)
    {
        if(andy[i]==0)
        {
            count_andy[a+1] = 0;
            a++;
        }
        else
        count_andy[a]++;
    }
if(maxi(count_andy,n)>maxi(count_om,n))
{
    cout<<"ADDY"<<endl;
}
else if(maxi(count_andy,n)<maxi(count_om,n))
{
    cout<<"OM"<<endl;
}
else
{
    cout<<"DRAW"<<endl;
}
   
    
    
    
}


return 0;
}