Minimum Coin Change
Updated
Problem statement
Given positive coin denominations coins and a target amount, return the minimum number of coins whose values sum to exactly amount. Each denomination may be used any number of times.
Function
coinChange(coins: int[], amount: int) → intExamples
Example 1
coins = [1,2,5]amount = 11return = 311 = 5 + 5 + 1, so three coins are sufficient, and no two available coins sum to 11.
More MulticoreWare Online Assessment questions
Similar questions at other companies
- Maximum Game Score with Fixed Forward JumpsStripe · OAStripe interview questions
- 0/1 KnapsackConfluent · OAConfluent interview questions
- Minimum Cost to Tile a Strip with Widths 1, 2, and 3Infosys · OAInfosys interview questions
- Maximum Escape Game ScoreMicrosoft · OAMicrosoft interview questions
- Maximum Subarray SumStraive · OA
- Longest Increasing Price SubsequenceOpenAI · OAOpenAI interview questions
- Lowest-Cost Shirt Color ScheduleElevenLabs · OAElevenLabs interview questions
- Maximum Game Board ScoreJP Morgan Chase · OAJP Morgan Chase interview questions
- API Bandwidth AllocationArista Networks · OAArista Networks interview questions
- Maximum Points by Deleting ElementsIBM · OAIBM interview questions