This fails on change(500, [2, 7, 13])

Result: 404

Answer: 717

Anyone know what is wrong?

```
/**
* @param {number} amount
* @param {number[]} coins
* @return {number}
*/
var change = function(amount, coins) {
var dp = [1];
for (var i = 0; i < coins.length; ++i) {
for (var j = coins[i]; j <= amount; ++j) {
if (!dp[j])
dp[j] = 0;
dp[j] += dp[j - coins[i]];
}
}
return dp[amount] || 0;
};
```