Does robot moves circular
Easy Accuracy: 45.01% Submissions: 1582 Points: 2

Given a sequence of moves for a robot. Check if the sequence is circular or not.

A sequence of moves is circular if the first and last positions of the robot are the same. A move can be one of the following :
G - Go one unit
L - Turn left
R - Turn right

Example 1:

Input: path = "GLGLGLG"
Output: "Circular"
Explanation: If we start form
(0,0) in a plane then we will
back to (0,0) by the end of the
sequence.


â€‹Example 2:

Input: path = "GGGGL"
Output: "Not Circular"
same place at the end of the path.

You don't need to read input or print anything. Your task is to complete the function isCircular() which takes the string path as input and returns "Circular" if the path is circular else returns "Not Circular".

Expected Time Complexity: O(|S|)
Expected Auxiliary Space: O(1)

Constraints:
1 ≤ |S| ≤ 105

We are replacing the old Disqus forum with the new Discussions section given below.