Geeksforgeeks

Error

Find the number of unique words consisting of lowercase alphabets only of length N that can be formed with at-most K contiguous vowels.

**Example 1:**

Input:N = 1 K = 0Output:21Explanation:All 21 consonants.

**Example 2:**

Input:N = 1 K = 1Output:26Explanation:All the english alphabets including vowels and consonants.

**Your Task:**

You don't need to read input or print anything. Your task is to complete the function **kvowelwords**() which takes an Integer N, an intege K and returns the total number of words of size N with atmost K vowels. As the answer maybe to large please **return answer modulo 1000000007**.

**Expected Time Complexity:** O(N*K)

**Expected Auxiliary Space:** O(N*K)

**Constraints:**

1 ≤ N ≤ 1000

0 ≤ K ≤ N

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

YesLoading...

Number of distict Words with k maximum contiguous vowels

...