Right Shift | C++
Intuition\n Describe your first thoughts on how to solve this problem. \nIn every iteration shift the ith element to i + 1 and for element z  add it to the posi
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nIn every iteration shift the $$i$$th element to $$i + 1$$ and for element $$z $$ add it to the position 0 and 1 which represent a and b.\n\n# Complexity\n- Time complexity: O(n*26)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(26)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int lengthAfterTransformations(string s, int t) {\n      int mod = 1e9+7;\n      vector<int> freq(26 , 0);\n      \n      int n = s.length();\n\n      for(int i=0;i<n;i++){\n        freq[s[i] - \'a\']++;\n      }\n\n      for(int i=0;i<t;i++){\n        int temp = freq[25];\n        for(int j=24;j>=0;j--){\n            freq[j + 1] = freq[j]; \n        }\n        freq[0] = temp;\n        freq[1] = (freq[1] + temp) % mod;\n      }\n      int sum = 0;\n      for(int i=0;i<26;i++){\n        sum = (sum + freq[i])%mod;\n      }\n      return sum;\n    }\n};\n```
['C++']