Getting wrong answer in one test case

one test case is not passing. below is my code -

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

int main()
{
int n;
cin>>n;

if(n>=130)
{
    cout<<"YES"<<endl;

    return 0;
}
else
{
    bool ans = false;

    int arr[n];

    for (int i = 0; i < n; i++)
    {
        cin>>arr[i];
    }

    sort(arr,arr+n);
    
    for(int i=0;i<n;i++)
    {
        for(int j=i;j<n;j++)
        {
            for(int k=j;k<n;k++)
            {
                int a = arr[i];
                int b = arr[j];
                int c = arr[k];

                int d = a^b^c;

                ans = binary_search(arr,arr+n,d);
            }
        }
    }

    if(ans)
    {
        cout<<"YES"<<endl;
    }
    else
    {   
        cout<<"NO"<<endl;
    }
}



return 0;

}

Hi @vritant2405
u can simply run 4 loops and check… refer this https://ide.codingblocks.com/s/637693

Hi @vritant2405
i hope its clear now?

Hey @Vaibhav277

I tried the code given by you but still one test case is not passing. Its giving same error.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.