Python for 657


  • 0
    Q

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

        if (U==D) and (L==R):
           return True
        else:
           return False

Log in to reply
 

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