LeetCode 1835. Find XOR Sum of All Pairs Bitwise AND
Input: arr1 = [1,2,3], arr2 = [6,5]
Output: 0
Explanation: The list = [1 AND 6, 1 AND 5, 2 AND 6, 2 AND 5, 3 AND 6, 3 AND 5] = [0,1,2,0,2,1].
The XOR sum = 0 XOR 1 XOR 2 XOR 0 XOR 2 XOR 1 = 0.Input: arr1 = [12], arr2 = [4]
Output: 4
Explanation: The list = [12 AND 4] = [4]. The XOR sum = 4.Solution
PreviousLeetCode 1834. Single-Threaded CPUNextLeetCode 1836. Remove Duplicates From an Unsorted Linked List
Last updated