Computer Science, asked by Tjahnavi, 3 months ago

check if a given sequence of moves for robot is circular or not in c program​

Answers

Answered by MasterSolver2
0

Answer:

Check if a given sequence of moves for a robot is circular or not

Difficulty Level : Medium

Last Updated : 06 Nov, 2020

Given a sequence of moves for a robot, check if the sequence is circular or not. A sequence of moves is circular if first and last positions of robot are same. A move can be on of the following.

 G - Go one unit

 L - Turn left

 R - Turn right  

Examples:

Input: path[] = "GLGLGLG"

Output: Given sequence of moves is circular Input: path[] = "GLLG"

Output: Given sequence of moves is circular

Explanation:

Similar questions