SOFTWARE TESTING
TEST PLAN AND TEST CASE DEVELOPMENT
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Array value 2 times
|
|
Array value 1 times
|
|
Array value 3 times
|
|
None of the above
|
Detailed explanation-1: -The coin change problem seeks a solution that returns the minimum number of coins required to sum up to the given value. The recursive approach checks the length of all the combinations which sum up to the given value and returns the minimum combination length.
Detailed explanation-2: -The change-making problem addresses the question of finding the minimum number of coins (of certain denominations) that add up to a given amount of money. It is a special case of the integer knapsack problem, and has applications wider than just currency.
Detailed explanation-3: -C++ Code. int coinChange(vector<int> const &S, int sum) if (sum == 0) return 0; if (sum < 0) return INT MAX; int coins = INT MAX; for (int i: S) int result = coinChange(S, sum-i); if (result != INT MAX) coins = min(coins, result + 1); return coins; Java Code. Python Code. 15-Jun-2022