SHARE
TWEET

PE2a

Cloude Feb 21st, 2020 (edited) 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top