Data Structures & AlgorithmsHardICPC regional · Codeforces Div2 B

Problem: How many subsets (including the empty set) of [1, 2, 3, 4, 5] have bitwise XOR equal to 0?

  1. A. 5
  2. B. 4
  3. C. 3
  4. D. 6

Correct answer: B. 4

Enumerate all 32 subsets and check the XOR of each. The empty set has XOR zero and is included, which matters for the total.

More Coding Interview Problems questions

Exams that ask this topic