Company: Ability_20oct
Difficulty: medium
Robot Path Rectangle Problem Description A plotting robot starts out at point (0, 0) on a coordinate plane, and the string moves lists out the path it will trace. Each character of the string represents a single step, and the robot executes them in the exact order they appear, beginning from (0, 0). Suppose the robot has already carried out some steps and now sits at point (x, y). If the next character in the string is: ^ - the robot will move to (x, y + 1); v - the robot will move to (x, y - 1); > - the robot will move to (x + 1, y); < - the robot will move to (x - 1, y); Every time it moves, the robot draws a line segment connecting its old position to its new one. It's guaranteed that following the instructions in moves never sends the robot through the same point twice, except possibly for (0, 0), which the robot may visit exactly twice — once at the very start and once at the very end of its path. Once every move has been carried out, work out whether the shape traced by the