a b c d e
f g h i j
k l m n o
p q r s t
u v w x y
z
The cursor starts on a (row 0, column 0). The remote has U, D, L and R to move the cursor one cell up, down, left or right (only onto a cell with a letter), and ! to type the letter under the cursor.
Return the key presses that type word with as few presses as possible. To make the answer unique, when moving to the next letter press all the needed L first, then U, then R, then D, and only then !. This order never takes the cursor off the grid.word="bug" → 'R!LDDDD!UUUR!'
b is one step right: R!. To u (row 4, column 0): L, then DDDD. To g (row 1, column 1): UUU, then R.
word="zoo" → 'DDDDD!UUURRRR!!'
z is straight down: DDDDD!. To o (row 2, column 4): up first, UUU, then right, RRRR. The second o is just another !.
word="ya" → 'RRRRDDDD!LLLLUUUU!'
word consists of lowercase English lettersword="bug"
'R!LDDDD!UUUR!'
Run checks the first 3 tests in your browser. Submit checks all 104 tests on the server, hidden ones included.