Tap here to switch tabs
Problem
Submissions

Problem: Inverse Coin Change

Inverse Coin Change gives the counts of distinct combinations for each positive amount and asks you to recover the strictly increasing coin denominations, or return an empty array if impossible.

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] ≤2×108\leq 2 \times 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Inverse Coin Change

Inverse Coin Change gives the counts of distinct combinations for each positive amount and asks you to recover the strictly increasing coin denominations, or return an empty array if impossible.

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] ≤2×108\leq 2 \times 10^8