Help me in solving BGME problem

My issue

can someone tell where is this coe has issues

int t;
cin>>t;
while (t–)
{

int n;
cin>>n;
vectorarr(n);
for (int i = 0; i < n; i++)
{
cin>>arr[i];
}
sort(arr.begin(),arr.end());
int alice =0,bob=0;
int sum=0;
for (int i = 0; i < arr.size(); i++)
{
if ((sum+arr[i])%2!=0)
{
alice=alice+1;
}
else{
bob=bob+1;
}
sum+=arr[i];
}
cout<<((alice>bob)?“alice”:“bob”)<<endl;
}

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
int t;
cin>>t;
while (t--)
{
    

int n;
cin>>n;
vector<int>arr(n);
for (int i = 0; i < n; i++)
    {
        cin>>arr[i];
    }
sort(arr.begin(),arr.end());
int alice =0,bob=0;
int sum=0;
for (int i = 0; i < arr.size(); i++)
{
    if ((sum+arr[i])%2!=0)
    {
        alice=alice+1;
    }
    else{
        bob=bob+1;
    }
    sum+=arr[i];
}
cout<<((alice>bob)?"alice":"bob")<<endl;
}
return 0;
}

Problem Link: Bucket Game Practice Coding Problem - CodeChef

@ayushgupta3445
your approach is not right bro
plzz refer my c++ code for better understanding

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int a[n];
        int cnt=0,cnt1=0;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            if(a[i]%2!=0)
            {
                if(a[i]==1)
                cnt1++;
                else
                cnt++;
            }
        }
        if(cnt1%2==0)
        {
            if(cnt%2!=0)
            {
                cout<<"Alice";
            }
            else if(n==cnt1)
            cout<<"Draw";
            else
            cout<<"Bob";
        }
        else
        {
            if(cnt==1&&cnt+cnt1==n)
            cout<<"Draw";
            else if(cnt%2!=0)
            cout<<"Bob";
            else
            cout<<"Alice";
        }
        cout<<endl;
    }
}