this solution is quite similiar to the top discuss, but the result went wrong.

```
public int change(int amount, int[] coins) {
int[] dp = new int[amount+1];
dp[0] = 1;
for(int i=1;i<=amount;i++){
for(int coin:coins){
if (i-coin>=0) {
dp[i]+=dp[i-coin];
}
}
}
return dp[amount];
}
```