← All problemsSign in

One-XOR Deletions

CodeChefRating 1516Open on judge ↗

Chef has with him an array $A$ of length $N$. In one move, he can delete any element from $A$. Find the minimum number of deletions Chef must make so that the following condition holds: - Let $B$ denote the resulting array, and $M$ be the length of $B$. - Then, $B_i \oplus B_j \leq 1$ for every $1 \leq i, j \leq M$. Here, $\oplus$ denotes the [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_o

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start