Skip to content

Instantly share code, notes, and snippets.

@nosada
Created December 21, 2013 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nosada/8070954 to your computer and use it in GitHub Desktop.
Save nosada/8070954 to your computer and use it in GitHub Desktop.
To make sure
def make_bricks(small, big, goal):
if goal - 5*big > small: # small + 5*big < goal (impossible)
return False
else: # small + 5*big >= goal (partial possible)
if goal%5 > small:
return False
else:
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment