https://leetcode.com/problems/robot-return-to-origin/
class Solution:
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
list1 = [0,0]
for i in moves:
if i == 'U':
list1[1] += 1
elif i == 'D':
list1[1] -= 1
elif i== 'L':
list1[0] -=1
else:
list1[0] +=1
if list1[0] == 0 and list1[1] == 0:
return True
return False