Hiring process8 levels
  1. 1 IQ Test
  2. 2 Additional Online Test (If Required)
  3. 3 Office Interview with Hiring Manager
  4. 4 Unpaid Test Task (Motivation Check)
  5. 5 Paid Test Task and Follow-Up Interview
  6. 6 Iterative Paid Test Tasks
  7. 7 Office Verification
  8. 8 Final Interview with the Founder

Problems > Fewest Coins > Editorial

Fewest Coins — Solution & Editorial

Back to the Problem

Unbounded-knapsack DP over amounts: dp[v] = 1 + min dp[v−c]. Greedy by largest coin fails for sets like {1, 3, 4} with T = 6.

Complexity: O(N·T)

Watch out: {1,3,4} and T=6: greedy takes 4+1+1 (three coins); DP finds 3+3 (two).