#K60777. Robot Navigation
Robot Navigation
Robot Navigation
Given a string of instructions, your task is to determine the final coordinates of a robot starting at ((0, 0)) in the Cartesian plane. Each instruction consists of a direction letter ((N), (S), (E), and (W)) immediately followed by an integer representing the number of steps to take in that direction. The integer may contain leading zeros. For instance, the input "E2N1W1S3" means the robot moves 2 steps east, 1 step north, 1 step west, and finally 3 steps south, resulting in a final position of ((1, -2)).
inputFormat
A single line of input containing the string of encoded instructions. The string may be empty, which indicates that the robot does not move.
outputFormat
Print the final x and y coordinates separated by a space.## sample
E2N1W1S3
1 -2