657._Judge_Route_Circle.md

September 27, 2020 · View on GitHub

657. Judge Route Circle

题目: https://leetcode.com/problems/judge-route-circle/

难度:

Easy

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