Counting || Java || Without DP || Clean and Concise Solution || Beats 91%
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    public static int mod = (int)(1e9 + 7);\n    public int lengthAfterTransformations(String s, int t) {\n        final int n = s.length();\n        final int[] count = new int[26];\n\n        for (int i = 0; i < n; i++) {\n            count[s.charAt(i) - \'a\']++;\n        }\n\n        while(t-- > 0) {\n            final int prevZCount = count[25];\n\n            for (int i = 25; i > 0; i--) {\n                count[i] = count[i - 1];\n            }\n\n            count[0] = prevZCount;\n            count[1] = (count[1] + prevZCount) % mod;\n        }\n\n        int ans = 0;\n        for (int i = 0; i < 26; i++) ans = (ans + count[i]) % mod;\n\n        return ans;\n    }\n}\n```
['Java']