Pairs With Given Xor Time : Space : 12345678910int Solution::solve(vector<int> &A, int B) { int res = 0; unordered_map<int, int> freq; for(auto a : A) { res += freq[a^B]; freq[a]++; } return res;}