Trail scouts mark a route using waystone glyphs. Each glyph string has even length: the character at every even index (0-indexed) is a lowercase base rune, and the character at every odd index is a single advance digit from '0' to '9'. The advance digit tells scouts how many letters forward in the alphabet the rune immediately before it must be shifted to reveal the true trail rune -- for example, shifting 'a' forward by 3 gives 'd', and shifting forward by 0 leaves the rune unchanged. Reveal the trail by replacing every advance digit with its shifted rune, leaving the base runes at even positions untouched, and print the resulting glyph string.
A single line containing the waystone glyph string s.
Print a single line: the string obtained after replacing every advance digit with its revealed rune.
Example 1
Input
a1c1e1
Expected
abcdef
Explanation
The base runes are at indices 0, 2, 4 ('a', 'c', 'e') and the advance digits are at indices 1, 3, 5 (all '1'). Shifting 'a' forward by 1 gives 'b', shifting 'c' forward by 1 gives 'd', and shifting 'e' forward by 1 gives 'f'. Replacing each digit with its revealed rune while leaving the base runes untouched gives "abcdef".
Example 2
Input
z0y0
Expected
zzyy
Explanation
The advance digits are both '0', meaning no shift is applied: the digit after 'z' becomes 'z' itself, and the digit after 'y' becomes 'y' itself. The base runes stay as they are, giving "zzyy".
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →