Tap here to switch tabs
Problem
Submissions

Problem: Inverse Coin Change

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

Statement

You are given an integer array numWays, where numWays[i - 1] represents the number of distinct combinations to form an amount of ii (for 1≤i≤1 \leq i \leq numWays.length) using an infinite supply of coins with distinct positive integer denominations.

Return an array containing the coin denominations in strictly increasing order that produces the given numWays array. If no such set of denominations exists, return an empty array.

Constraints:

  • 1≤1 \leq numWays.length ≤100\leq 100

  • 0≤0 \leq numWays[i] ≤2imes108\leq 2 imes 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Inverse Coin Change

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

Statement

You are given an integer array numWays, where numWays[i - 1] represents the number of distinct combinations to form an amount of ii (for 1≤i≤1 \leq i \leq numWays.length) using an infinite supply of coins with distinct positive integer denominations.

Return an array containing the coin denominations in strictly increasing order that produces the given numWays array. If no such set of denominations exists, return an empty array.

Constraints:

  • 1≤1 \leq numWays.length ≤100\leq 100

  • 0≤0 \leq numWays[i] ≤2imes108\leq 2 imes 10^8