Question: You are given two integers N and K . You have to find the total number of strings of length N , which satisfy the

You are given two integers N and K. You have to find the total number of strings of length N, which satisfy the following conditions:
String only contains lowercase english characters.
No K consecutive characters of the string are same.
Return the answer by taking modulo with 1e9+7.
Example 1:
Input:
N=2,K=2
Output:
650
Explanation:
Total number of possible strings with 2 characters is 26**26 in which 26 strings have 2 consecutive characters like {aa,bb,dots}. Therefore the answer is 26*26-26=650. writecode in java. de
 You are given two integers N and K. You have to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!