My issue
I am submitting this solution in O(n2) time but my solution is not being accepted.
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
unordered_map<int,int> mp;
int n;
cin>>n;
int arr[n];
long long ans =0;
for(int i=0;i<n;i++){
cin>>arr[i];
for(int j=i-1;j>=0;j--){
mp[arr[i]^arr[j]]++;
ans+=mp[arr[i]^arr[j]]-1;
}
}
cout<<ans*8<<endl;
}
}
Problem Link: Xometry (Easy Version) Practice Coding Problem