LeetCode 2425, Medium. Topics: Array, Bit Manipulation, Brainteaser. View on LeetCode.
Generate this problem as a practice environment: tested reference solution, 21 parametrized pytest cases, and a playground notebook:
Problem
You are given two 0-indexed arrays, nums1 and nums2, consisting of non-negative integers. Let there be another array, nums3, which contains the bitwise XOR of all pairings of integers between nums1 and nums2 (every integer in nums1 is paired with every integer in nums2 exactly once).
Return the bitwise XOR of all integers in nums3.
Examples
Constraints
- 1 <= nums1.length, nums2.length <= 10^5
- 0 <= nums1[i], nums2[j] <= 10^9
Solution
Reference implementation from solution.py on GitHub, full suite in test_solution.py:
Complexity
NeetCode All. Last modified on September 7, 2026