SumXor
For an array $B$ of length $M$, we define two functions: - Let $f(B)$ denote its bitwise XOR. That is, $f(B) = B_1\oplus B_2\oplus\ldots\oplus B_M$, where $\oplus$ denotes the [bitwise XOR]((https://en.wikipedia.org/wiki/Bitwise_operation#XOR)) operation. - Let $g(B)$ denote the sum of bitwise XORs of all its subarrays. That is, $$ g(B) = \sum_{i=1}^M \sum_{j=i}^M f([B_i, B_{i+1}, \ldots, B_j
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start