Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Coins to be Added

med
30 min
Try to solve the Minimum Number of Coins to be Added problem.

Statement

Given a 00 indexed integer array coins representing the values of available coins, and an integer target, determine the minimum number of coins of any value that must be added to the array such that every integer from 11 to target inclusive can be formed as the sum of a subset of elements in coins.

Constraints:

  • 1≤1 \leq target ≤105\leq 10^5

  • 1≤1 \leq coins.length ≤105\leq 10^5

  • 1≤1 \leq coins[i] ≤\leq target

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Coins to be Added

med
30 min
Try to solve the Minimum Number of Coins to be Added problem.

Statement

Given a 00 indexed integer array coins representing the values of available coins, and an integer target, determine the minimum number of coins of any value that must be added to the array such that every integer from 11 to target inclusive can be formed as the sum of a subset of elements in coins.

Constraints:

  • 1≤1 \leq target ≤105\leq 10^5

  • 1≤1 \leq coins.length ≤105\leq 10^5

  • 1≤1 \leq coins[i] ≤\leq target