Easy Java Frequency
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nEarlier i was using the same array as original but later i realized it wa
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nEarlier i was using the same array as original but later i realized it was making the data corrupt by wrong counts \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 final int MOD = 1000000007;\n    public int lengthAfterTransformations(String s, int t) {\n        \n        int arr[] = new int[26];\n        Arrays.fill(arr,0);\n        for(int i=0;i<s.length();i++){\n            arr[s.charAt(i)-\'a\']++;\n        }\n\n        while(t>0){\n            int temparr[] = new int[26];\n            for(int i=0;i<arr.length;i++){\n                if(i==arr.length-1){\n                    int temp = arr[25];\n                    temparr[0]= (temparr[0] +temp)%MOD;\n                    temparr[1]= (temparr[1] +temp)%MOD;\n                   \n                    \n                }\n                else{\n                    int temp = arr[i];\n                    temparr[i+1]= (temparr[i+1] +temp) %MOD;\n                   \n                }\n            }\n            arr=temparr;\n            t--;\n        }\n        int count=0;\n       for (int i = 0; i < 26; i++) {\n            count = (count + arr[i]) % MOD;\n        }\n        return count;\n    }\n}\n```
['Math', 'Counting', 'Java']