check if a given sequence of moves for robot is circular or not in c program
Answers
Answered by
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
Business Studies,
1 month ago
Math,
1 month ago
Computer Science,
1 month ago
Social Sciences,
3 months ago
English,
9 months ago
Math,
9 months ago