97 reputation
4
bio website
location California
age 28
visits member for 2 years
seen Jan 23 at 18:23

Full-time Software Engineer


Jul
27
comment Strategy/algorithm to divide pot to chips
More specifically, it is the change-making/coin-change problem. While it is definitely analogous to the knapsack problem, it can be a little tough wrapping your head around the algorithm while thinking in terms of knapsacks and weight.
Jul
27
comment Strategy/algorithm to divide pot to chips
Dynamic programming is definitely the correct approach. It is worth mentioning that, depending on the chip denominations, you may have multiple optimal solutions for a given pot size. If you require a result that returns all of the optimal solutions, you'll have to modify the result array (in this case, MoneyArray) to store a list of solutions (which will be arrays themselves).
Jul
27
awarded  Critic
Jul
14
awarded  Supporter
Jul
14
awarded  Teacher
Jul
13
awarded  Autobiographer