Math, asked by anilkumarbodipally, 3 months ago

Aman is the CEO of a security company. He wants to send a secret

message S to his colleague. The message is a single word consisting of

only lowercase English letters but due to security reasons he decides to

encrypt the message and makes a string X of length Y, such that after

deleting a substring of non-zero length from X, the remaining string is S.

Calculate the number of all such possible strings X he can form.

Sample Input 1:

Y = 3, S = a

Sample Output 1:

1326

Sample Input 2:
Y = 3, S = ab

Sample Output:

76

Answers

Answered by prajwalchaudhari
2

Answer:

a security company. He wants to send a secret

message S to his colleague. The message is a single word consisting of

only lowercase English letters but due to security reasons he decides to

encrypt the message and makes a string X of length Y, such that after

deleting a substring of non-zero length from X, the remaining string is S.

Calculate the number of all such possible strings X he can form.

Similar questions