#K56677. Final Position of the Bot
Final Position of the Bot
Final Position of the Bot
You are given a string of commands that direct a bot moving on an infinite two-dimensional grid. The bot starts at the origin \((0, 0)\). Each command in the string is one of the following characters:
- U: Move up, increasing the \(y\) coordinate by 1.
- D: Move down, decreasing the \(y\) coordinate by 1.
- L: Move left, decreasing the \(x\) coordinate by 1.
- R: Move right, increasing the \(x\) coordinate by 1.
Your task is to compute the final position of the bot after executing all commands. For example, given the command string "UDLR", the bot returns to the origin \((0, 0)\).
inputFormat
The input consists of a single line containing a string of characters. The string can include only the characters 'U', 'D', 'L', and 'R'.
outputFormat
Output a single line with two integers separated by a space representing the final \(x\) and \(y\) coordinates of the bot.
## sampleUDLR
0 0