Company: Quince_sde
Difficulty: medium
Is Robot Path a Simple Cycle? body { font-family: sans-serif; line-height: 1.6; color: #333; } h1 { color: #2c3e50; } h2 { color: #34495e; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-top: 25px; } pre { background-color: #ecf0f1; padding: 10px; border-radius: 5px; overflow-x: auto; } code { font-family: 'Courier New', monospace; } ul { list-style-type: disc; margin-left: 20px; } li { margin-bottom: 5px; } Is Robot Path a Simple Cycle? Problem Description A robot starts at (0,0) on an infinite 2D grid. It is given a string moves that dictates its movement. The characters in moves correspond to the following actions: '<' : Move one unit to the left (decrease x-coordinate). '>' : Move one unit to the right (increase x-coordinate). '^' : Move one unit upwards (increase y-coordinate). 'v' : Move one unit downwards (decrease y-coordinate). '_' : Stay at the current position. Your task is to determine if the path traced by the robot, starting from (0,0) and executing all i