Simple Approach usinf freq of characters
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```java []\nclass Solution {\n  int MOD = (int)1e9+7;\n    public int lengthAfterTransformations(String s, int t) {\n      int sum = 0;\n        int[] freq = new int[26];\n        for(char ch : s.toCharArray()){\n          freq[ch-\'a\']++;\n        }\n        for(int j = 1; j <= t; j++){\n          int tempfreq[] = new int[26];\n          tempfreq[0] += freq[25];\n          tempfreq[1] += freq[25];\n          freq[25] = 0;\n          for(int i = 0; i < 25; i++){\n            // freq[i]--;\n            if(freq[i] == 0) continue;\n            tempfreq[i+1] = (tempfreq[i+1]+(freq[i]%MOD))%MOD;\n            freq[i] = 0;\n          }\n          tempfreq[0] = (tempfreq[0]+freq[25]%MOD)%MOD;\n          tempfreq[1] = (tempfreq[1]+freq[25]%MOD)%MOD;\n          freq[25] = 0;\n          for(int i = 0; i < 26; i++){\n            freq[i] = tempfreq[i];\n          }\n          // System.out.println(Arrays.toString(freq));\n        }\n        for(int i = 0; i < freq.length; i++){\n          sum = (sum+(freq[i])%MOD)%MOD;\n        }\n        return sum;\n    }\n}\n```
['Array', 'Java']