You are given an array of coin denominations and an integer max, and you are asked to form every integer amount from 1 up to max using these coins.
Find the minimal number of coins used while still being able to create every value in the range [1, max]. Return -1 if these coin denominations cannot form any amount in that range.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected