【leetcode】657. Judge Route Circle

这个很简单,也终于实现了一次单行返回

class Solution(object):
    def judgeCircle(self, moves):
        """
        :type moves: str
        :rtype: bool
        """
        return (moves.count('U')==moves.count('D')) and (moves.count('L')==moves.count('R'))

37ms  96.64%


猜你喜欢

转载自blog.csdn.net/u014381464/article/details/80720742