Data Structures & AlgorithmsModerateCodeforces Div2 B · bitmask

Problem: How many states does a bitmask DP over subsets of n = 15 items have?

  1. A. 15! states
  2. B. 15^2 states
  3. C. 2^15 = 32768
  4. D. 2 * 15 states

Correct answer: C. 2^15 = 32768

Each subset is one state, so there are 2^n = 32768 states for n = 15.

More Coding Interview Problems questions

Exams that ask this topic