You are viewing a single comment's thread. Return to all comments →
Python 3
import itertools def stones(n, a, b): if n == 1: return [0] combos = itertools.combinations_with_replacement([a,b], n-1) return sorted(set(map(sum, combos)))
Seems like cookies are disabled on this browser, please enable them to open this website
Manasa and Stones
You are viewing a single comment's thread. Return to all comments →
Python 3