Given the following input:
- An integer
n > 0.
- A string
sis not empty and
s~=[0-9A-Z]+(alpha-numeric capitals only).
Using a standard, simplified QWERTY keyboard (as shown below):
1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM
Perform the following operation:
- Find the original row that each character is in on the keyboard.
- Replace the letter with the correct shifted equivalent for
nbased on its original position + n.
keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
f("0PLM",1) = 1QAZ f("ZXCVB",2) = CVBNM f("HELLO",3) = LYDDW f("0PLM",11) = 1QSV f("0PLM",2130) = 0PHX
- This is code-golf, lowest byte-count wins.
This is slightly more difficult than it seems at first glance.