← All problemsSign in

Ravi and his binary numbers

In the recent exam a question came based on binary numbers. according to the question you will be given a number N . We all know that we can generate 2^N combinations . Now we have to print the number of good binary numbers in the 2^n combinations A binary number is called good if there no substring '111' else it is bad binary number .since the answer is very large output the answer modulo 10^9+7

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