JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
A first draft of the recipe | Reply
Re: A first draft of the recipe (response to post by Dumitru) | Reply
There is a bug in the line
numCoins = numCoins[i - Coins[c]] + 1;

I guess it should be
numCoins[i] = numCoins[i - Coins[c]] + 1;
Re: A first draft of the recipe (response to post by anastasov.bg) | Reply
Hello,

Hi

This is an important question regarding operators and operands. I think we should use dynamic programming approach.

We have n operands and m operators. For example:
operands = {a,b,c,d}
operators = {*, -, +, /}

We must put operators between operands and create all of the possibility permutations.
F1 = a+b+c+d
F2 = a+b+c-d
F2 = a+b-c-d
....
Fi = a*b+c/d;

I could not implement the program.
Thank you very much.
RSS