Problem Statement: There is a robot starting at the position (0, 0), the origin, on a 2D plane. You are given a string moves that represents the move sequence of the robot where moves[i] represents its ith move. Valid moves are 'R' (right), 'L' (left), 'U' (up), and 'D' (down). Find the final position of robot on 2-D plane.
Sample Inputulrrdll
Sample Output
(-1, 0)
Solution in | C | JAVA | PYTHON |
---|