medium Dynamic Programming 35 points

Coin Change

Given an array of coin denominations and a total amount, return the fewest number of coins needed to make up that amount. Return -1 if it cannot be done.

Problem Description

Given an array of coin denominations and a total amount, return the fewest number of coins needed to make up that amount. Return -1 if it cannot be done.

Examples

Example

Input: [1,5,11,15], 11

Output: 1

Challenge Info

35 Points

Reward

medium

Difficulty

No limit

Time Limit

Submission Stats

Total Submissions 0
Accepted 0
Success Rate 0%