• + 0 comments
    def getWays(n, c):
        count = [0]*(n+1)
        count[0] = 1
        c.sort(reverse = True) 
        for coin in c:
            for i in range(coin, n +1):
                count[i] += count[i-coin]
        return count[n]
    		
    

    sorting is done in order to understand how denomination is formed