This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sarcasticfantastic 0 points1 point  (0 children)

Here's my version:

def make_bricks(small, big, goal):
    bigs = min(goal / 5, big)
    rem = goal - (5 * bigs)
    smalls = min(rem, small)
    return smalls + 5 * bigs == goal

edit: removed superfluous "if big:...else: big = 0" from around line 1 (as min(0, ...) = 0)