Skip to content

Commit

Permalink
657
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Jan 14, 2022
1 parent 0e17a5e commit 21308fc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions E_657_RobotReturnToOrigin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class Solution:
def judgeCircle(self, moves: str) -> bool:
retVal=0
for i in moves:
if i=="U":
retVal+=1
if i=="D":
retVal-=1
if i=="R":
retVal+=10000
if i=="L":
retVal-=10000
if retVal==0:
return True
else:
return False

0 comments on commit 21308fc

Please sign in to comment.