JavaScript Program to Count Strings with Consecutive 1âs
Given a number n, count the Optimized number of n-length strings with consecutive 1s in them.Examples:Input : n = 2Output : 1There are 4 strings of length 2, thestrings are 00, 01, 10 and 11. Only the string 11 has consecutive 1's.Input : n = 3Output : 3There are 8 strings of length 3, thestrings ar