XOR with Add X
You are given an array $A$ of $N$ integers, and a positive parameter $X$. You may perform the following action as many times as you want (possibly $0$): - Choose $i$ $(1 \le i \le N)$ and modify $A_i$ to $A_i + X$. Find the minimum possible value of $A_1 \oplus A_2 \oplus \ldots \oplus A_N$ at the end of the actions, where $\oplus$ denotes the [Bitwise XOR operator](https://en.wikipedia.org/wik
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