Coin Change II Problem

Coin Change II Problem — ExecCode Medium DSA Practice

Solve the Coin Change II problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given an integer array coins representing coins of different denominations and an integer amount. Return the number of combinations that make up that amount. You may use each coin an unlimited number of times. Order does not matter.

Examples

Input amount = 5, coins = [1, 2, 5]; Output 4. Input amount = 3, coins = [2]; Output 0. Input amount = 10, coins = [10]; Output 1

Constraints

1 ≤ coins.length ≤ 300 1 ≤ amount ≤ 5000

Practice Coin Change II free on ExecCode. Browse DSA problems, topic map, and placement guides.