657 Robot Return to Origin Description link Solution See Code Code O(n) class Solution: def judgeCircle(self, moves: str) -> bool: cnt = collections.Counter(moves) return cnt['U'] == cnt['D'] and cnt['L'] == cnt['R']