Simple Java Solution
Code\njava []\nclass Solution {\n    public int lengthAfterTransformations(String s, int t) {\n        long ch[]=new long[26];\n        long ans=0;\n        for
# Code\n```java []\nclass Solution {\n    public int lengthAfterTransformations(String s, int t) {\n        long ch[]=new long[26];\n        long ans=0;\n        for(int i=0;i<s.length();i++)\n        {\n            ch[s.charAt(i)-\'a\']++;\n        }\n        for(int i=0;i<t;i++)\n        {\n            long p[]=new long[26];\n            for(int j=0;j<25;j++)\n            {\n                if(ch[j]!=0)\n                {\n                    p[j+1]=ch[j];\n                    p[j+1]= p[j+1]%(1000000007);\n                }\n            }\n            if(ch[25]!=0)\n            {\n                p[0]+=ch[25];\n                p[0]=p[0]%(1000000007);\n                p[1]+=ch[25];\n                p[1]=p[1]%(1000000007);\n            }\n\n            ch=p;\n        }\n\n        for(int i=0;i<26;i++)\n        {\n            ans+=ch[i];\n\n        }\n\n        return (int)(ans%(1000000007));\n\n    }\n}\n```
['Java']