Okey, here the example code. I have a problem with return string in count_change func
_types = [1, 5, 10, 25, 50]; // coin types
// this programm count number of ways to exchange money(to example)
// amount ? sum for exchange
// n ? number of coins (5 to example )
function count_change(amount, n) {
if (amount == 0) {
return 1;
} else if (amount < 0 or n == 0) {
return 0;
} else {
return count_change(amount, n - 1) + count_change(amount - type(n), n); /////////////// How to write THIS string in C2 ??
}
}
// nominal value returns n-type coins
function type(n) {
return _types[n - 1];
}