Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def raiseItMinLength(n):
- from itertools import combinations_with_replacement as C
- r = range(8)
- a=[x**y for x in r for y in r]
- for i in r:
- for x in C(a[:8:-1],i):
- if sum(x)==n:
- return i
- return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement