Given a positive integer N, count all possible distinct binary strings of length N such that there are no consecutive 1’s.
Input: N = 2 Output: 3 // The 3 strings are 00, 01, 10 Input: N = 3 Output: 5 // The 5 strings are 000, 001, 010, 100, 101
Please refer complete article on Count number of binary strings without consecutive 1’s for more details!
My Personal Notes arrow_drop_up
- Python Program to print digit pattern
- Python | Extract key-value of dictionary in variables
- Binary string with given frequencies of sums of consecutive pairs of characters
- Python program to convert time from 12 hour to 24 hour format
- Google Chrome Dino Bot using Image Recognition | Python
- Python | Use of __slots__
- Python - Summation of float string list
- Python | Animated Banner showing 'GeeksForGeeks'
- Python | Segregate list elements by Suffix
- Python Program for Selection Sort
- Python Program for Bubble Sort
- Python Program for Insertion Sort
- Python Program for Heap Sort
- Python Program for Counting Sort
- Python Program for Radix Sort