Find Maximum Number of Strings
You are given 2 integers n and k. We have to find the maximum possible number of strings of size n such that the difference between 2 adjacent characters in the string is less than or equal to k. Given, all characters of the string should be smallcase alphabets.
The difference between 2 characters means the difference between their position in the alphabet list. For example, f - c = 3, b - a = 1.
1Example 1
For example, if we take the string "ab", the difference between a and b is 1. Thus this is a valid string.
Similarly the strings "cd", "ce", "cf", "gi" are also valid.
Like this there are 170 strings of length n = 2 that are fulfilling the condition.
Constraints
Limits and guarantees your solution can rely on.
1 <= n <= 10^61 <= k <= 25