from collections import Counter
def judgeCircle(self, moves):
:type moves: str
c = Counter(moves)
return (c['U'] == c['D']) and (c['L'] == c['R'])
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.