GATE Computer ScienceVery hardGATE CSE

How many binary strings of length 12 do not contain three consecutive 1s as a substring?

  1. A. 1705
  2. B. 377
  3. C. 1817
  4. D. 2391

Correct answer: A. 1705

Let a(n) = a(n−1)+a(n−2)+a(n−3) with a(0..2) = 1, 2, 4; a(12) = 1705 (confirmed by enumeration).

More Algorithms questions

Exams that ask this topic