Easiest solution possible :)
Intuition \nmaintaining frequency for each character\n Describe your first thoughts on how to solve this problem. \n\n\n Describe your approach to solving the p
# Intuition \nmaintaining frequency for each character\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n)\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    private static final int MOD = 1000000007;\n\n    public int lengthAfterTransformations(String s, int t) {\n        ArrayList<Long> arr = new ArrayList<>();\n        for (int i = 0; i < 26; i++) \n        {\n            arr.add(0L);\n        }\n\n        for (int i = 0; i < s.length(); i++) \n        {\n            arr.set(s.charAt(i) - \'a\', arr.get(s.charAt(i) - \'a\') + 1);\n        }\n\n        long length = s.length(); \n\n        for (int i = 0; i < t; i++) \n        {\n            long zCount = arr.get(25); \n            for (int j = 25; j > 0; j--) \n            {\n                arr.set(j, arr.get(j - 1));\n            }\n\n            arr.set(0, zCount);  // \'z\' becomes \'a\'\n            arr.set(1, (arr.get(1) + zCount) % MOD);  // \'z\' also becomes \'b\'\n\n            length = (length + zCount) % MOD;\n        }\n\n        return (int) length;\n    }\n}\n\n```
['Java']