Optimal Algorithmic Approach
Bottom-up DP with 1D array.
Core Invariants & Edge Cases
- dp[i] = min coins to make amount i
- dp[0] = 0; dp[i] = min(dp[i - coin] + 1) for each coin ≤ i
- If dp[amount] == INT_MAX, return -1
Find the fewest coins needed to make up a given amount.
Bottom-up DP with 1D array.
Coding interviews are only 50% of the bar. Master High-Level Design, distributed systems, and Object-Oriented LLD.