Guest User

Untitled

a guest
Nov 24th, 2011
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. def solvebig():
  2.     for num_nuggets in range(1,60):
  3.         #can we make num_nuggets? ind indicates if we can
  4.         ind = False
  5.         for a in range(0, num_nuggets + 1):
  6.             for b in range(0, num_nuggets + 1):
  7.                 for c in range(0, num_nuggets + 1):
  8.                     if 6*a + 9*b + 20*c == num_nuggets:
  9.                         ind = True
  10.         #what streak of achievable combos are we on?
  11.         if ind:
  12.             streak += 1
  13.         else:
  14.             streak = 0
  15.         #if its the 6th, we're done
  16.         if streak == 6:
  17.             return num_nuggets - 6
  18.  
Advertisement
Add Comment
Please, Sign In to add comment