SHOW:
|
|
- or go back to the newest paste.
| 1 | def solvebig(): | |
| 2 | x = 0 | |
| 3 | for num_nuggets in range(1, 60): | |
| 4 | for a in range(0, num_nuggets+1): | |
| 5 | for b in range(0, num_nuggets - a + 1): | |
| 6 | for c in range(0, num_nuggets - a - b +1): | |
| 7 | tot_nuggets = 6*a + 9*b + 20*c | |
| 8 | if tot_nuggets == num_nuggets: | |
| 9 | - | x = x + 1 |
| 9 | + | |
| 10 | num_nuggets += 1 | |
| 11 | if x == 6: #any streak greater than 6 means a possible combo | |
| 12 | #for all future numbers | |
| 13 | return num_nuggets - 6 | |
| 14 | break | |
| 15 | if tot_nuggets == num_nuggets: | |
| 16 | - | x = 0 |
| 16 | + | break |
| 17 | if tot_nuggets == num_nuggets: | |
| 18 | break | |
| 19 | elif a == num_nuggets: | |
| 20 | x = 0 | |
| 21 | ||
| 22 |