Total Characters in String After Transformations I - Practice Coding | SlaveCode
0
0123456789
0
0123456789
:
0
0123456789
0
0123456789
3335. Total Characters in String After Transformations I
Medium
30 Points
Hash Table
Math
String
Dynamic Programming
Counting
You are given a string s and an integer t, representing the number of transformations to perform. In one transformation, every character in s is replaced according to the following rules:
Return the length of the resulting string after exactly t transformations.
Since the answer may be very large, return it modulo 109 + 7.
Examples
Example 1
Input: s = "abcyy", t = 2
Output: 7
Explanation:
Example 2
Input: s = "azbk", t = 1
Output: 5
Explanation:
Constraints
1 <= s.length <= 105
s consists only of lowercase English letters.
1 <= t <= 105
3335. Total Characters in String After Transformations I
Medium
30 Points
Hash Table
Math
String
Dynamic Programming
Counting
You are given a string s and an integer t, representing the number of transformations to perform. In one transformation, every character in s is replaced according to the following rules:
Return the length of the resulting string after exactly t transformations.
Since the answer may be very large, return it modulo 109 + 7.