word of lowercase English letters and an integer rounds. In one round every letter of the string is replaced at the same time:
- z turns into the two letters ab;
- any other letter turns into the next letter of the alphabet (a → b, m → n, and so on).
Return the length of the string after exactly rounds rounds. The answer can be huge, so return it modulo 10⁹ + 7.word="xyz", rounds=2 → 5
After round one: y, z, ab gives "yzab". After round two: z, ab, b, c gives "zabbc", which is 5 characters.
word="hello", rounds=3 → 5
No letter reaches z within three steps, so the string just shifts and keeps its length of 5.
word="a", rounds=27 → 2
word consists of lowercase English letters onlyword="xyz", rounds=2
5
Run checks the first 3 tests in your browser. Submit checks all 89 tests on the server, hidden ones included.