#K80987. Final Robot Position
Final Robot Position
Final Robot Position
A robot initially starts at the origin \((0,0)\)
It receives a sequence of moves represented by a string composed of the characters 'U', 'D', 'L', and 'R'. Each character corresponds to a unit move in the following directions:
- \(U\): Move up (increase \(y\) by 1)
- \(D\): Move down (decrease \(y\) by 1)
- \(L\): Move left (decrease \(x\) by 1)
- \(R\): Move right (increase \(x\) by 1)
Your task is to calculate the final position of the robot after all the moves have been executed. The answer should be output as two integers representing \(x\) and \(y\) respectively, separated by a space.
inputFormat
The input consists of a single line containing a non-empty string that represents the sequence of movements. The string is composed solely of the characters 'U', 'D', 'L', and 'R'.
outputFormat
Output the final \(x\) and \(y\) coordinates of the robot separated by a space.
## sampleUUDDLLRR
0 0
</p>