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…
More MongoDB interview questions
- Binary Decoder / Simplified BSON Parser
- Union Iterator for Two Sorted Iterators (Dedup, Streaming, O(1) Extra Space)
- Two-Team Turn-Based Battle Simulator
- Toy Language Type System
- Grid Infection and Immunity Simulation
- Earliest Supporting Version with a Probe Budget