Coin Denominations
You are given an integer $C$ and an array $A$ = $A_1, A_2, \ldots, A_N$ which has distinct positive integers. It is guaranteed that $A_i \leq C$ for $1 \leq i \leq N$. You have an infinite supply of coins of denomination $A_i$ for $1 \leq i \leq N$. You have another array $W = W_1, W_2, \ldots W_N$. This denotes that a single coin of denomination $A_i$ has a weight of $W_i$. You are given $M$ que
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start