Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 192 Bytes

657. Robot Return to Origin.md

File metadata and controls

9 lines (7 loc) · 192 Bytes
class Solution:
    def judgeCircle(self, moves: str) -> bool:

        h=moves.count('R')-moves.count('L')
        v=moves.count('U')-moves.count('D')

        return (h==0 and v==0)