On an infinite plane, a robot is positioned at instructions.
Each character in instructions represents one of the following actions:
'G': Move forward
'L': Turn
'R': Turn
The robot performs the entire sequence of instructions in order, repeating it indefinitely.
Return true if there exists a circle in the plane that the robot never leaves, and false otherwise.
Constraints:
instructions.length
instructions[i] is 'G', 'L', or 'R'
On an infinite plane, a robot is positioned at instructions.
Each character in instructions represents one of the following actions:
'G': Move forward
'L': Turn
'R': Turn
The robot performs the entire sequence of instructions in order, repeating it indefinitely.
Return true if there exists a circle in the plane that the robot never leaves, and false otherwise.
Constraints:
instructions.length
instructions[i] is 'G', 'L', or 'R'