Deposit combinations

Write codeMedium15 minGoogle and Amazon style

Your task

A savings app lets users schedule deposits only in fixed amounts, for example 1, 2, and 5 dollars, with unlimited uses of each. Given the list of distinct positive deposit amounts and a savings goal, return how many different combinations of deposits reach the goal exactly. Two combinations are the same if they use each amount the same number of times; order does not matter. A goal of 0 has exactly one combination: deposit nothing.

Examples

count_deposit_mixes(amounts: list[int], goal: int) -> int
Example 1
Inputcount_deposit_mixes([1, 2, 5], 5)
Output4
Example 2
Inputcount_deposit_mixes([2, 3], 12)
Output3