← All problemsSign in

Coin Combinations I

CSESDynamic ProgrammingOpen on judge ↗

Consider a money system consisting of n coins. Each coin has a positive integer value. Your task is to calculate the number of distinct ways you can produce a money sum x using the available coins. For example, if the coins are \{2,3,5\} and the desired sum is 9, there are 8 ways: - 2+2+5 - 2+5+2 - 5+2+2 - 3+3+3 - 2+2+2+3 - 2+2+3+2 - 2+3+2+2 - 3+2+2+2 Input The first input line has two

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start