Podcast Lookup

Count Binary Strings

algodextrous

  • July 3, 2021
  • 5 min
  • Season 2, episode 12
Episode page

About this episode

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