Simple BruteForce JAVA (O(n))
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n1. use a freq and nextF
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. use a freq and nextFreq to iterate over every transformation done and count at the end to get result\n# Complexity\n- Time complexity:O(t*26)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    int MOD = 1000000007;\n\n    public int lengthAfterTransformations(String s, int t) {\n        long[] freq = new long[26];\n        for (char c : s.toCharArray()) {\n            freq[c - \'a\']++;\n        }\n        for (int i = 0; i < t; i++) {\n            long[] nextFreq = new long[26];\n            for (int j = 0; j < 26; j++) {\n                if (j == 25) {\n                    nextFreq[0] = (nextFreq[0] + freq[j]) % MOD; \n                    nextFreq[1] = (nextFreq[1] + freq[j]) % MOD; \n                } else {\n                    nextFreq[j + 1] = (nextFreq[j + 1] + freq[j]) % MOD; \n                }\n            }\n            freq = nextFreq;\n        }\n        long length = 0;\n        for (long count : freq) {\n            length = (length + count) % MOD;\n        }\n        return (int) length;\n    }\n}\n\n```
['Java']