Question 13

Count number of strings of length N with following properties:

A. Consists of char ‘A’ and ‘B’ only.

B. There is atleast one occurrence of 3 consecutive Bs.

Input: Only line having integer N.

Output: Number of string with given properties. As then number can be very large print it with modulo 10^9+7.

Sample Input 1:


Sample Input 2:


Explanation: Only possible string “BBB”

KodNest Training New Batch is starting on 15th July 2020Check Now

New Report