Advertisement
Cloude

PE2a

Feb 21st, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. def is_possible(shop, total):
  2.  
  3. def recur(shopa, totala):
  4. if totala < 0:
  5. return False
  6. elif totala == 0:
  7. return True
  8. else:
  9. ans = False
  10. for bundle in shopa:
  11. if recur(shopa, totala - get_size(bundle)):
  12. ans = True
  13. break
  14. return ans
  15. finalans = False
  16. for bundle in shop:
  17. if is_pink_rose(bundle):
  18. if recur(shop, total - get_size(bundle)):
  19. finalans = True
  20. break
  21.  
  22.  
  23. return finalans
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement