Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_possible(shop, total):
- def recur(shopa, totala):
- if totala < 0:
- return False
- elif totala == 0:
- return True
- else:
- ans = False
- for bundle in shopa:
- if recur(shopa, totala - get_size(bundle)):
- ans = True
- break
- return ans
- finalans = False
- for bundle in shop:
- if is_pink_rose(bundle):
- if recur(shop, total - get_size(bundle)):
- finalans = True
- break
- return finalans
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement