python solution


  • 0
    U
    class Solution:
        def judgeCircle(self, moves):
            """
            :type moves: str
            :rtype: bool
            """
            if not moves:
                return Ture
            moves = moves.lower()
            if moves.count('u') == moves.count('d') and moves.count('r') == moves.count('l'):
                return True
            return False
    

Log in to reply
 

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