Easy Solution, Very Easy
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 mod = 1000000007;\n\n    int getLength(int t, char c, vector<vector<int>>& dp) {\n        int ct = \'z\' - c;\n        int len = 0;\n        int ch = (c == \'a\') ? 0 : 1;\n       \n\n        if (dp[t][ch] != -1)\n            return dp[t][ch];\n\n        if (ct < t) {\n            int lenA = getLength(t - ct-1, \'a\', dp) % mod;\n            int lenB = getLength(t - ct-1, \'b\', dp) % mod;\n            len = (lenA + lenB) % mod;\n        } else {\n            len= 1;\n        }\n        \n        return dp[t][ch] = len;\n    }\n\n    int lengthAfterTransformations(string s, int t) {\n        long long len = 0;\n        vector<vector<int>> dp(t + 1, vector<int>(2, -1));\n\n        for (int i = 0; i < s.size(); i++) {\n            int ct = \'z\' - s[i];\n            if (t > ct) {\n                int lenA = getLength(t - ct-1, \'a\', dp) % mod;\n                int lenB = getLength(t - ct-1, \'b\', dp) % mod;\n                len = (len + lenA + lenB) % mod;\n            } else {\n                len = (len + 1) % mod;\n            }\n        }\n        return len;\n    }\n};\n\n```
['Math', 'Dynamic Programming', 'Recursion', 'Memoization', 'C++']