Sort by

recency

|

744 Discussions

|

  • + 0 comments
    def getWays(n, c):
        ways = [0] * (n + 1)
        ways[0] = 1
        for coin in c:
            for i in range(coin, n + 1):
                ways[i] += ways[i - coin]
        return ways[n]
        
    
  • + 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

  • + 0 comments

    How can i find good designer for my Website? [https://hhftraining.co.uk/

  • + 0 comments

    The Coin Change Problem involves finding the number of ways to make a given amount using a set of coins with specified denominations. It's commonly solved using dynamic programming to optimize calculations z7. Let me know if you need further clarification or code examples!

  • + 1 comment

    The Coin Change Problem involves finding the number of ways to make change for a given amount using a set of coin denominations 3rr. It’s often solved using dynamic programming for efficiency.