Sum of XOR Values Over All Array Pairs

Given two arrays of non-negative integers, A and B, compute the sum of XOR values over every cross-array pair:

[ \sum_{a \in A}\sum_{b \in B}(a \oplus b) ]

where ⊕ denotes bitwise XOR.

**In...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: