Help me in solving AGAME problem

My issue

Alice will try to remove 2 numbers from odd or even indices while Bob will try to change the parity of sum of odd or even indices.

So, when N = 1 Bob cannot perform the operation but Alice can when the element is greater than 1.

Now check the sum of elements at even and odd indices separately. If they don’t match then Bob will always win because Alice removes 2 always and Bob shifts 1 between indices and so there will be one 1 at the end of all operations.

If they match, then there is a pattern of winning between Alice and Bob (They alternate in winning based on the sum of array and parity of sums of odd and even indices). Find that.

can,anyone explain last pattern when odd and even parity equal

My code

#include<bits/stdc++.h>
#define int long long int 
using namespace std;
signed main()
{
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<int>v(n);
        int odd=0,even=0;
        for(int i=0;i<n;i++){
            cin>>v[i];
            if(v[i]%2)
              odd+=v[i];
            else
              even+=v[i];
        }
        if(n==1){
            cout<<"Bob"<<endl;
            continue;
        }
        int cur=odd+even;
        if(cur%2)
          cout<<"Bob"<<endl;
        else{
            cur/=2;
            if(cur%2==even%2)
              cout<<"Bob"<<endl;
            else
              cout<<"Alice"<<endl;
        }
    }
}

Problem Link: Game on Array Practice Coding Problem - CodeChef

I think your hypothesis is not correct because in 2 1 1 thier sum of even not equal to sum of odd but Alice wins.
My hypothesis is if sum of A[i] is odd then Bob wins and if it is even we calculate sum of A at even and odd i’s.
step:
if any of even or odd(let it be n) > 1 then Alice can remove two of them(it becomes n-2) then Bob gets a chance of moving one from to other if any one is not equal to zero.
and same step continuous unless both left with 1 1 or 2 0 or 0 2 if it is 1 1 then Bob wins and if it is 2 0 or 0 2 then Alice wins.
so if (even-odd)%4 is 0 then Bob wins else Alice wins.