Company: Texas
Difficulty: medium
Minimum Coins for a Target Sum Given `n` coin denominations and a target sum, find the minimum number of coins needed to form the target. Each denomination may be used any number of times. Print `-1` if the target cannot be formed. Input Format The first line contains `n` and `target`. The second line contains `n` positive denominations. Output Format Print the minimum number of coins, or `-1`. Constraints `1 <= n <= 200`, `0 <= target <= 100000`, and each denomination is at most `100000`.