there robot start position 0 0 origin 2D plane give sequence move judge robot end 0 0 complete movesyou give string move represent sequence robot movesi represent ith Valid move r right L leave U D downreturn true robot return origin finish move false otherwisenote the way robot face irrelevant r robot right L leave etc also assume magnitude robot movement Example 1input move udoutput trueexplanation the robot move all move magnitude end origin started therefore return trueexample 2input move lloutput falseexplanation the robot move leave twice it end move leave origin we return false origin end move Constraints1 moveslength 2 104moves contain character U D L r