a to the end of the text;
- **Shift** replaces the last letter of the text with the next letter of the alphabet (a → b, …, y → z, and z wraps back to a).
The text starts out empty, so the first press can only be Add. You need to type the word word using as few key presses as possible.
Return the list of every text that appears after each press, in the order they appear.word="bad" → ['a', 'b', 'ba', 'baa', 'bab', 'bac', 'bad']
The first letter b: the screen shows a, then b. Next we add a, which is already the needed letter: ba. The third letter: baa, bab, bac, bad.
word="ca" → ['a', 'b', 'c', 'ca']
Getting c takes three states: a, b, c. The second letter a appears right after it is added.
word consists of lowercase English lettersword="bad"
['a', 'b', 'ba', 'baa', 'bab', 'bac', 'bad']
Run checks the first 3 tests in your browser. Submit checks all 43 tests on the server, hidden ones included.