3335. Total Characters in String After Transformations I (Solution)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python []\nclass Solution:\n    def lengthAfterTransformations(self, s, t):\n        MOD = 10**9 + 7\n        cnt = [0] * 26\n        for c in s:\n            cnt[ord(c) - ord(\'a\')] += 1\n        for _ in range(t):\n            tmp = [0] * 26 \n            \n            for i in range(26):\n                if i == 25: \n                    tmp[0] = (tmp[0] + cnt[i]) % MOD \n                    tmp[1] = (tmp[1] + cnt[i]) % MOD \n                else:\n                    tmp[i + 1] = (tmp[i + 1] + cnt[i]) % MOD\n            \n            cnt = tmp \n        return sum(cnt) % MOD\n\nif __name__ == "__main__":\n    sol = Solution()\n    print(sol.lengthAfterTransformations("abcyy", 2)) \n    print(sol.lengthAfterTransformations("azbk", 1))  \n\n```
['Python']