Practice Total Characters in String After Transformations II
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Total Characters in String After Transformations II
Problem Statement
Given a lowercase string s, t, and a 26-entry array nums, transform every character simultaneously in each round. A letter at alphabet index j is replaced by the next nums[j] letters in cyclic alphabetical order, excluding the starting letter unless reached again by wrapping. For example, y with nums[24] = 3 becomes zab. Return the string length after exactly t rounds, modulo 10^9 + 7.
Source: Total Characters in String After Transformations II on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "abcyy", t = 2, nums = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2]
7
# Example 2
s = "azbk", t = 1, nums = [2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
8
Constraints
Related LeetCode Problems
Practice more problems similar to Total Characters in String After Transformations II.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.