 All Problems
Coin Change II
medium
dynamic programming
arrays
amazon
google
microsoft
facebook

You are given an integer array coins and an integer amount. Return the number of combinations that make up that amount. You may use coins in any quantity.

Example 1:

Input coins: 1 2 5
Amount: 5
Output: 4

Example 2:

Input coins: 2
Amount: 3
Output: 0

Input format: Line 1: space-separated coin values. Line 2: amount.

Output format: Number of combinations.

Run to check your code against the sample cases, or submit to run every case