As reported: Omnissa (formerly VMware) MTS-2, Bengaluru (2026), .NET / C# team, round 1 DSA (eliminatory): Coin Change, built up from brute force to a better solution to the optimal 1-D DP, with code that compiles.
Given coin denominations coins (unlimited supply of each) and an amount, return the fewest coins needed to make exactly amount, or -1 if it is impossible. This is LeetCode 322 — Coin Change.
Example 1
coins = [1,2,5], amount = 11 -> 3 (5 + 5 + 1)
Example 2
coins = [2], amount = 3 -> -1
Constraints: 1 ≤ coins.length ≤ 12; 1 ≤ coins[i] ≤ 2^31 − 1; 0 ≤ amount ≤ 10^4.
Code runner format: one JSON value per line: coins, then amount (LeetCode's format). Implement coinChange(coins, amount); the harness prints the count.