Shifting Letters
Shifting a letter means replacing it with the next letter of the alphabet, and z wraps around to a. Given a string s and a list shifts of the same length, for each index i shift the first i + 1 letters of s by shifts[i] steps. So letter number j is shifted by shifts[j] + shifts[j+1] + ... up to the end of the list.
Return the final string.
Example 1
s "abc"
shifts [3,5,9]
returns "rpl"
a moves 17, b moves 14, c moves 9: rpl.
Constraints
1 <= len(s) <= 50len(shifts) == len(s)0 <= shifts[i] <= 100shas lowercase letters
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.