Find counterexample where greedy coin change fails
Analyze the find counterexample where greedy coin change fails.
Examples
Input: "test_input_1"
Output: "output_1"
Input: "test_input_2"
Output: "output_2"
Hints
Consider a coin system where the greedy approach fails to produce the optimal solution, such as one with denominations like [1, 3, 4] and a target amount of 6.
Construct a scenario where the greedy algorithm picks the largest possible denomination first, but this leads to a suboptimal solution, requiring more coins than an alternative combination.
Design a coin system where the greedy choice (largest denomination ≤ remaining amount) does not align with the optimal solution, proving that greedy fails for this system.
Find counterexample where greedy coin change fails
Analyze the find counterexample where greedy coin change fails.