EASIEST JAVA SOLUTION || GREEDY
\n# Complexity\n- Time complexity: O(26 * t)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(26) = O(1)\n Add your space complexity here, e
\n# Complexity\n- Time complexity: O(26 * t)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(26) = O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int lengthAfterTransformations(String s, int t) {\n        int n = s.length();\n        int mod = (int) 1e9 + 7;\n        int ans = 0;\n        int[] freq = new int[26];\n\n        for(char ch : s.toCharArray()) {\n            freq[ch - \'a\']++;\n        }\n\n        while(t-- > 0) {\n            int z = freq[25];\n\n            for(int i=24; i>=0; i--) {\n                freq[i+1] = freq[i];\n            }\n\n            freq[0] = z;\n            freq[1] = (freq[1] + z) % mod;\n        }\n\n        for(int i=0; i<26; i++) {\n            ans = (ans + freq[i]) % mod;\n        }\n\n        return ans;\n    }\n}\n```
['Greedy', 'Java']