Write a function that counts how many different ways you can make change for an amount of money, given an array of coin denominations. For example, there are 3 ways to give change for 4 if you have coins with denomination 1 and 2:
1+1+1+1, 1+1+2, 2+2.
The order of coins does not matter. Also, assume that you have an infinite amount of coins.