Keep dumping
IntuitionApproachComplexity

Time complexity:
O(n)


Space complexity:

Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
O(n)

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```javascript []
/**
 * @param {string} s
 * @param {number} t
 * @return {number}
 */
var lengthAfterTransformations = function (s, t) {
  let mod = 10 ** 9 + 7;
  let trans = Array(26).fill(0);
  let nexttrans = Array(26).fill(0);
  for (let e of s) {
    trans[e.charCodeAt(0) - 97]++;
  }
  let i = 0;

  while (i < t) {
    for (let i = 0; i < trans.length; i++) {
      if (trans[i] === 0) {
        continue;
      }
      if (i === 25) {
        nexttrans[0] = (nexttrans[0] + trans[i]) % mod;
        nexttrans[1] = (nexttrans[1] + trans[i]) % mod;
        continue;
      }
      nexttrans[i + 1] = trans[i];
      trans[i] = 0;
    }
    trans = nexttrans;
    nexttrans = Array(26).fill(0);
    i++;
  }
  return trans.reduce((acc, curr) => acc + curr, 0) % mod;
};
```
['JavaScript']