Tap here to switch tabs
Problem
Submissions

Problem: Total Characters in String After Transformations I

med
30 min
Try to solve the Total Characters in String After Transformations I problem.

Statement

You are given a string s and an integer t, which denotes the number of transformations to perform on s.

In one transformation, each character in s is simultaneously replaced according to these rules:

  • If the character is 'z', it is replaced by the string "ab".

  • For any other character, it is replaced by the next character in the English alphabet (for instance, 'a' becomes 'b', 'b' becomes 'c', and so forth).

Return the total number of characters in the string after applying t transformations. Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists only of lowercase English letters.

  • 1≤1 \leq t ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Total Characters in String After Transformations I

med
30 min
Try to solve the Total Characters in String After Transformations I problem.

Statement

You are given a string s and an integer t, which denotes the number of transformations to perform on s.

In one transformation, each character in s is simultaneously replaced according to these rules:

  • If the character is 'z', it is replaced by the string "ab".

  • For any other character, it is replaced by the next character in the English alphabet (for instance, 'a' becomes 'b', 'b' becomes 'c', and so forth).

Return the total number of characters in the string after applying t transformations. Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists only of lowercase English letters.

  • 1≤1 \leq t ≤105\leq 10^5