"a" and grows according to the array steps. On every step a copy of the word is appended to its right:
- if steps[i] == 0, the copy is exact;
- if steps[i] == 1, every letter of the copy is replaced by the next one in the alphabet (z wraps around to a). For example, "az" becomes "azba".
After all steps the word has 2^len(steps) letters. Return the letter at position position (1-based).
position can be huge, so building the word itself is not an option.position=6, steps=[1, 1, 0] → 'b'
"a" → "ab" → "abbc" → "abbcabbc". The sixth letter is "b".
position=4, steps=[0, 0] → 'a'
No letter is ever shifted: the word is "aaaa" and every position holds "a".
position=8, steps=[1, 1, 1] → 'd'
"a" → "ab" → "abbc" → "abbcbccd". The last letter is "d".
steps[i] is 0 or 1position lettersposition=6, steps=[1, 1, 0]
'b'
Run checks the first 3 tests in your browser. Submit checks all 48 tests on the server, hidden ones included.