Python solution with one line


  • 0
    W

    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')


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.