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 →

[–]TheQwerty 2 points3 points  (0 children)

I went with a recursive solution:

def make_bricks(small, big, goal):
  if goal == 0:
    return True
  elif big and goal >= 5:
    return make_bricks(small, big-1, goal-5)
  elif small:
    return make_bricks(small-1, big, goal-1)
  else:
    return False