There is an startPos
You are given the integer n, the array startPos, and a string s of length
'L': Move left by decreasing the column index by
'R': Move right by increasing the column index by
'U': Move up by decreasing the row index by
'D': Move down by increasing the row index by
For each starting instruction index i from startPos and executes the instructions in s sequentially starting from index i. The execution stops as soon as a move would take the robot off the grid or all remaining instructions are completed.
Return an array of length i.
Constraints:
m s.length
n, m
startPos.length
n
s consists of 'L', 'R', 'U', and 'D'.
There is an startPos
You are given the integer n, the array startPos, and a string s of length
'L': Move left by decreasing the column index by
'R': Move right by increasing the column index by
'U': Move up by decreasing the row index by
'D': Move down by increasing the row index by
For each starting instruction index i from startPos and executes the instructions in s sequentially starting from index i. The execution stops as soon as a move would take the robot off the grid or all remaining instructions are completed.
Return an array of length i.
Constraints:
m s.length
n, m
startPos.length
n
s consists of 'L', 'R', 'U', and 'D'.