class Solution:
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
m=moves.count("U")
n=moves.count("D")
j=moves.count("L")
k=moves.count("R")
return m==n and j==k
leetcode - 657 - 机器人能否返回原点
最新推荐文章于 2019-09-16 11:09:13 发布
class Solution:
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
m=moves.count("U")
n=moves.count("D")
j=moves.count("L")
k=moves.count("R")
return m==n and j==k