ruby one liner


  • 0
    S
    def judge_circle(moves)
      (moves.count("U") == moves.count("D")) && (moves.count("L") == moves.count("R"))
    end
    

Log in to reply
 

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