XOR Sum of All Pairs AND

Given two arrays, consider all pairs formed by taking one element from each. For each pair, compute the bitwise AND of the two elements, then XOR all those results together. The order of operations can be rearranged using properties of XOR and AND to avoid enumerating all pairs.

Examples
Input: [[1,2,3],[6,5]]
Output: 0
Hints

XOR Sum of All Pairs AND

Given two arrays, consider all pairs formed by taking one element from each. For each pair, compute the bitwise AND of the two elements, then XOR all those results together. The order of operations can be rearranged using properties of XOR and AND to avoid enumerating all pairs.