diff --git a/2425. Bitwise XOR of All Pairings b/2425. Bitwise XOR of All Pairings new file mode 100644 index 0000000..8849748 --- /dev/null +++ b/2425. Bitwise XOR of All Pairings @@ -0,0 +1,14 @@ +class Solution { +public: + int xorAllNums(vector& nums1, vector& nums2) { + int n1=nums1.size(), n2=nums2.size(); + unordered_mapfreq; + for(int n:nums1) freq[n]+=n2; + for(int n:nums2) freq[n]+=n1; + int res=0; + for(auto& [n,c]:freq){ + if(c%2==1) res^=n; + } + return res; + } +};