You are given an integer array coins representing available coin denominations and an integer amount representing a target total amount of money.
Your task is to calculate the number of distinct combinations of coins that sum up to the amount.
You may assume that:
Return the total number of distinct combinations. If no combination of coins can sum up to the amount, return 0.
amount = 11
coins = [1, 5, 10, 25]
4
The amount 11 can be made in three ways
amount = 3
coins = [5, 10, 25]
0
The amount 3 cannot be made with the given coin denominations.
amount = 0
coins = [1, 5, 10, 25]
1
There is one way to make the amount 0: by using no coins.
amount = 11
coins = [1, 5, 10, 25]
4