Skip to content

Practice Total Characters in String After Transformations I

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#3335
LeetCode Problem

Total Characters in String After Transformations I

Problem Statement

In each transformation of s, replace every z with ab and every other lowercase letter with the next letter in the alphabet. All characters transform simultaneously. After exactly t transformations, return the resulting string length modulo 10^9 + 7.

Source: Total Characters in String After Transformations I on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
s = "abcyy", t = 2
Output
7

# Example 2

Input
s = "azbk", t = 1
Output
5

Constraints

1 <= s.length <= 10^5
s consists only of lowercase English letters.
1 <= t <= 10^5

Related LeetCode Problems

Practice more problems similar to Total Characters in String After Transformations I.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.