Find the number of binary strings of length N with at least 3 consecutive 1s

Правка en1, от dahiyakuldeep304, 2021-01-30 09:00:04

we have an integer N, We have to find the number of all possible distinct binary strings of the length N, which have at least three consecutive 1s. So if n = 4, then the numbers will be 0111, 1110, 1111, so output will be 3.

Can anyone have any idea how to use dynamic programming here. It will be a great help. Thanks for advance.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский dahiyakuldeep304 2021-01-30 09:00:04 413 Initial revision (published)