A robot starts at the origin on a 2D plane and receives a sequence of moves in moves.
Each character in moves represents one move:'U' moves the robot up, 'D' moves it down, 'L' moves it left, and 'R' moves it right.
Return true if the robot returns to the origin after completing all moves. Otherwise, return false.
Note: The robot starts at the origin.
Constraints:
moves.length
moves only contains the characters 'U', 'D', 'L', and 'R'
A robot starts at the origin on a 2D plane and receives a sequence of moves in moves.
Each character in moves represents one move:'U' moves the robot up, 'D' moves it down, 'L' moves it left, and 'R' moves it right.
Return true if the robot returns to the origin after completing all moves. Otherwise, return false.
Note: The robot starts at the origin.
Constraints:
moves.length
moves only contains the characters 'U', 'D', 'L', and 'R'