Tap here to switch tabs
Problem
Submissions

Problem: Find XOR Sum of All Pairs Bitwise AND

med
30 min
Try to solve the Find XOR Sum of All Pairs Bitwise AND problem.

Statement

The XOR sum of an array is defined as the bitwise XOR of all its elements (evaluating to 00 for an empty array).

Given two integer arrays arr1 and arr2, consider a list constructed by taking the bitwise AND operation between every element arr1[i] and every element arr2[j], for all 0≤i<0 \leq i < arr1.length and 0≤j<0 \leq j < arr2.length.

Return the XOR sum of this constructed list.

Constraints:

  • 1≤1 \leq arr1.length, arr2.length ≤105\leq 10^5

  • 0≤0 \leq arr1[i], arr2[j] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find XOR Sum of All Pairs Bitwise AND

med
30 min
Try to solve the Find XOR Sum of All Pairs Bitwise AND problem.

Statement

The XOR sum of an array is defined as the bitwise XOR of all its elements (evaluating to 00 for an empty array).

Given two integer arrays arr1 and arr2, consider a list constructed by taking the bitwise AND operation between every element arr1[i] and every element arr2[j], for all 0≤i<0 \leq i < arr1.length and 0≤j<0 \leq j < arr2.length.

Return the XOR sum of this constructed list.

Constraints:

  • 1≤1 \leq arr1.length, arr2.length ≤105\leq 10^5

  • 0≤0 \leq arr1[i], arr2[j] ≤109\leq 10^9