


'G': it means that the robot will move 1 unit in the direction it is facing.
'L': it means that the robot will move 90 degrees towards its left. For example, if the robot is facing north and it has to make an ‘L’ move, then it will start facing the west direction.
'R': it means the robot will move 90 degrees towards its right. For example, if the robot is facing north and it has to make an ‘R’ move then it will start facing the east direction.
The first line contains an integer 'T' which denotes the number of test cases/queries to be run.
Then the test cases follow.
The first and the only line of input for each test case/query contains a string representing the sequence of moves.
The sequence of moves will always be:
1. A valid one.
2. In uppercase characters without spaces in between.
For each test case, print a single line containing ‘True’ if the sequence of moves is circular, print ‘False’ otherwise(without quotes).
The output for every test case will be printed in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the function.
1 <= T <= 100
0 <= N <= 10 ^ 4
All the characters of the string will be ‘L’, ‘R’, and ‘G’.
Time Limit: 1 sec.
Initialize a variable ‘direction’ with 0 which means that the robot is initially facing towards the north.
direction: 0 -> Robot is facing towards the North
direction: 1 -> Robot is facing towards the West
direction: 2 -> Robot is facing towards the South
direction: 3 -> Robot is facing towards the West
Initialize two variables ‘x’ and ‘y’ as 0. They will represent the position of the robot which is initially (0,0). Now, execute the moves from the sequence one by one and
Now simply check if the current position is (0,0) or not. If it is (0,0) then this sequence of moves is circular otherwise it is not circular.