Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mirrorSum(lis,x,cont=0):
- #@param lis : list
- #@param x : int
- #@return bool
- if len(lis)<=1:
- if cont>0:
- return True
- else:
- if x==0:
- return True
- else:
- return False
- else:
- if x-lis[0]==lis[len(lis)-1]:
- lis=lis[1:-1]
- return mirrorSum(lis,x,cont+1)
- else:
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement