Publicis Sapient online Assesment
Anonymous User
2527

let n and k two integers are given and you have to find the total numbers of string that you can make using vowels{a,e,i,o,u} and consonants such that not more than k vowels occur together.
ans is very high so return ans % (1e9 + 7).
example:
n = 3, k = 1
ans = 21 * 21 * 21 + 3*(5 * 21 * 21) + 5 * 21 * 5 is the answer.
n and k are not very small.
can anyone help?

Comments (6)