Easy 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```cpp []\nclass Solution {\npublic:\n    int lengthAfterTransformations(string s, int k) {\n        const int MOD=1e9+7;\n        vector<int> hash(26, 0);\n\n    for (char ch : s) {\n        hash[ch - \'a\']++;\n    }\n\n    for (int i = 0; i < k; ++i) {\n        vector<int> new_count(26, 0);\n\n\n        for (int j = 0; j < 25; ++j) {\n            new_count[j + 1] = hash[j];\n        }\n\n    \n        new_count[0] = hash[25];\n        new_count[1] = (new_count[1] + hash[25]) % MOD;\n\n        hash = new_count; \n    }\n\n\n    long long res = 0;\n    for (int num : hash) {\n        res = (res + num) % MOD;\n    }\n    return res;\n    }\n};\n```
['C++']