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
Input: path = "GLGLGLG"
Explanation: If we start form
(0,0) in a plane then we will
back to (0,0) by the end of the
Input: path = "GGGGL"
Output: "Not Circular"
Explanation: We can't return to
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)