Java 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:\nO(t+26)\n\n- Space complexity:\nO(26)=constant\n# Code\n```java []\nclass Solution {\n    public int lengthAfterTransformations(String s, int t) {\n        long mod = 1_000_000_007;\n        int freq[]=new int [26];\n        for(char ch:s.toCharArray()){\n            freq[ch-\'a\']++;\n        }\n        while(t-->0){\n            int z=freq[25];\n            for(int i=24;i>=0;i--){\n                freq[i+1]=freq[i];\n                freq[i]=0;\n            }\n            freq[0]+=z;\n            freq[1]+=z;\n            freq[0]%=mod;\n            freq[1]%=mod;\n        }\n        int ans=0;\n        for(int i=0;i<26;i++){\n            ans+=freq[i];\n            ans%=mod;\n        }\n        return ans;\n    }\n}\n```
['Java']