Skip to content
zarza zarza

Count Binary Strings

03/07/2021 5 min Temporada 2 Episodio 12

Listen "Count Binary Strings"

Episode Synopsis

1. You are given a number n.
2. You are required to print the number of binary strings of length n with no consecutive 0's.
Input Format
A number n
Output Format
A number representing the number of binary strings of length n with no consecutive 0's.
Constraints
0 < n <= 45
Sample Input
6
Sample Output
21

ZARZA Studio — Your station on air today: library, music clock, schedule, studio and reports, from the browser.

Meet ZARZA Studio
on air now stations in the catalogue 1,829,025 podcasts countries