- Podcasts
- algodextrous
- Count Binary Strings
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.
2. You are required to print the number of binary strings of length n with no consecutive 0's.
Input Format
A number nOutput Format
A number representing the number of binary strings of length n with no consecutive 0's.Constraints
0 < n <= 45Sample Input
6Sample Output
21