Mathematics (JEE)Very hardCodeforces Div2 C

How many strings of length 6 over {0, 1, 2} contain no substring 01 and do not end with the symbol 2?

  1. A. 233
  2. B. 377
  3. C. 729
  4. D. 466

Correct answer: A. 233

Enumerating all 729 strings and keeping those without the substring 01 whose last symbol is 0 or 1 leaves 233.

More Permutations, Combinations and Probability questions

Exams that ask this topic