IntermediateRating 1200
Where Is the Robot?
A robot at (0, 0) receives commands like
N 3, E 2, S 1, W 4 until END. Print its final position and the Manhattan distance from the start.Input
Commands, then END.
Output
Two lines.
Sample 1
Input
N 3 E 2 S 1 W 4 END
Output
-2 2 4
Sample 2
Input
END
Output
0 0 0
Output appears here