You are viewing a single comment's thread. Return to all comments →
@cache def getWays(n, c): if n == 0: return 1 if len(c) == 0: return 0 if c[0] > n: return getWays(n, c[1:]) sm = 0 for i,e in enumerate(c): sm += getWays(n - e, c[i:]) return sm
Seems like cookies are disabled on this browser, please enable them to open this website
The Coin Change Problem
You are viewing a single comment's thread. Return to all comments →