āš ļø Blockly failed to load. Check your internet connection and refresh.
Coin Change
Problem
You have unlimited coins of value 1 and value 3.

What is the minimum number of coins needed to make exactly N euros?
🧠 DP Concept
dp[i] = minimum coins to make exactly i euros.

Base case: dp[0] = 0 (zero euros needs zero coins).
Recurrence: For each i ≄ 1:
— Option A: use a 1-coin → dp[iāˆ’1] + 1
— Option B (if i ≄ 3): use a 3-coin → dp[iāˆ’3] + 1
— dp[i] = min of the available options.

šŸ’” Use an if/else to handle i < 3 (only option A available) vs i ≄ 3 (both options).
Input Variables (pre-loaded)
šŸ’” Drag N, set dp[i], get dp[i], and the min block from the toolbox.
Your Output
Result
—
Run your program to see the result.
Execution Log
Ready. Press ā–¶ Run to start.
Expected Answer
Answer:
?
Hint