DP Bottom Up, beats 95%
\n#define MOD 1000000007;\nclass Solution {\npublic:\n    int lengthAfterTransformations(string s, int t) {\n        int arr[26];\n        int prev, next;\n    
```\n#define MOD 1000000007;\nclass Solution {\npublic:\n    int lengthAfterTransformations(string s, int t) {\n        int arr[26];\n        int prev, next;\n        int sum = 0;\n        memset(arr, sizeof(arr), 0);\n        for (int i = 0; i < s.length(); i++) {\n            arr[s[i] - \'a\']++;\n        }\n        for (int i = 1; i <= t; i++) {\n            prev = 0;\n            for (int j = 0; j < 26; j++) {\n                next = arr[j];\n                arr[j] = prev;\n                prev = next;\n            }\n            arr[0] = (arr[0] + prev) % MOD;\n            arr[1] = (arr[1] + prev) % MOD;\n        }\n        \n        for (int i = 0; i < 26; i++) {\n            sum = (sum + arr[i]) % MOD;\n        }\n        \n        return sum;\n    }\n};\n```
[]