Python solution


  • 0
    X
    class Solution(object):
        def judgeCircle(self, moves):
            """
            :type moves: str
            :rtype: bool
            """
            return (moves.count('U') == moves.count('D'))&(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.