Minimum XOR Sum Over Permutations

Asked at MongoDB · Coding Questions · Difficulty: Hard

You are given two integer arrays `nums1` and `nums2`, both of length `n`. You may reorder the elements of `nums2` in any way. After reordering, the XOR sum is the total of `nums1[i] XOR nums2[i]` over all indices `i`. Find the smallest XOR sum you can reach.

Loading the problem…