Tap here to switch tabs
Problem
Submissions

Problem: Coin Change II

med
30 min
Try to solve the Coin Change II problem.

Statement

Given an integer amount and an array coins where each value represents a coin denomination, return the number of distinct combinations that sum exactly to amount. You may use each coin denomination in coins any number of times, and the order of coins in a combination does not matter.

Note: A combination is defined by the counts of each denomination used, not by the sequence in which coins are chosen.

Constraints:

  • 11 \leq coins.length 300\leq 300

  • 11 \leq coins[i] 5000\leq 5000

  • All values in coins are unique.

  • 00 \leq amount 5000\leq 5000

Tap here to switch tabs
Problem
Submissions

Problem: Coin Change II

med
30 min
Try to solve the Coin Change II problem.

Statement

Given an integer amount and an array coins where each value represents a coin denomination, return the number of distinct combinations that sum exactly to amount. You may use each coin denomination in coins any number of times, and the order of coins in a combination does not matter.

Note: A combination is defined by the counts of each denomination used, not by the sequence in which coins are chosen.

Constraints:

  • 11 \leq coins.length 300\leq 300

  • 11 \leq coins[i] 5000\leq 5000

  • All values in coins are unique.

  • 00 \leq amount 5000\leq 5000