A robot starts at position (0, 0). Given a sequence of its moves, judge if this robot makes a complete trip. A complete trip means the robot ends back at the original location.
The valid robot moves are "R" (Right), "L" (Left), "U" (Up) and "D" (down). For example, a sequence of moves could be "RRLUUD". The robot would move:
- Move 1 unit to the right
- Move another 1 unit to the right
- Move 1 unit to the left
- Move 1 unit up
- Move another 1 unit up
- Move 1 unit down
- Q: How big is the grid?
- A: It does not matter. Assume there is a fixed number of commands received by the robot. But the world is not bounded.
- Q: Can I import anything from Python's Standard Library?
- A: No, No imports allowed.