657. Robot Return to Origin

Posted accumulationbystep

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了657. Robot Return to Origin相关的知识,希望对你有一定的参考价值。

class Solution:
    def judgeCircle(self, moves: str) -> bool:
        u,d,l,r = 0,0,0,0
        for move in moves:
            if move is ‘U‘:
                u += 1
            elif move is ‘D‘:
                d += 1
            elif move is ‘L‘:
                l += 1
            elif move is ‘R‘:
                r += 1
        if u!=d or l!=r:
            return False
        return True

  76ms,13.1M

以上是关于657. Robot Return to Origin的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode 657. Robot Return to Origin

[Leetcode]657. Robot Return to Origin

657. Robot Return to Origin

(Easy) Robot Return to Origin LeetCode

ROS机器人编程:原理与应用(A Systematic Approach to Learning Robot Programming with ROS 中文译版)

robot framework窗口切换