[Solved] An algorithm to find the exact amount to add to a top-up a card
[ad_1] The problem you describe is actually a very difficult problem in general, since it is related to the knapsack problem. But it is only hard if you allow very large amounts of money on the card and very many different prices. For your real world problem with very few different prices you can solve … Read more