You are given a list coins of different denominations and a total amount of money amount. Write a function to compute the number of combinations that make up that amount. Each coin can be used any amount of times. If amount cannot be made up by any combination of the coins, return 0.
Input
coins: A list of the coins and their denominations.
amount: The target amount
Output
The number of combinations that make up that amount.
Examples
Example 1
Input
coins = [1, 2, 5]
amount = 5
Output: 4
Explanation
There are four ways to make up the amount:
Example 2
Input
coins = [2]
amount = 3
Output: 0
Explanation
The amount of 3 cannot be made up with just coins of 2.
Constraints