Help with Game on a Strip.Only 50 marks was awarded.What is wrong with the solution

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define umii unordered_map<int,int>
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);

int t;cin>>t;
while(t--)
{
    int n;cin>>n;
    int arr[n];vector<int> count(n,0);
    int odd=0,even=0,k=0;
    for(int i=0;i<n;i++)
    {
         cin>>arr[i];
    }
    
   //count arr that stores count of kth 0 subarray
    for(int i=0;i<n;i++)
    {
         if(!arr[i]){
             count[k]++;
             if(i!=n-1 && arr[i+1]==1){
                 k++;
             }
         }
    }
    
   
    //calculating odd,even that store max odd length,even length
    for(int i=0;i<n;i++){
        if(count[i]){
            count[i]&1 ? odd=max(odd,count[i]):even=max(even,count[i]);
        }else{
            break;
        }
    }
    
    if(!odd || even>odd/2) {
        cout<<"No"<<endl;
    }else{
       cout<<"Yes"<<endl; 
    }
   
}
return 0;

}

@sattyr24

On these test cases, your code fails :-
2
5
0 1 0 1 0
5
0 1 0 1 1

Correct Output:
No
No

Your Output:
Yes
Yes

1 Like