Your question is Lottery Coupons or Coin Change. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
TraceLink Product Track may evaluate rule sets containing reusable numeric values. Given a collection of coin or coupon denominations and a target value, return every unique combination whose values sum to the target.
Each denomination may be selected unlimited times. The input may contain duplicate denomination values, but duplicate combinations must appear only once. Within every combination, values must be in nondecreasing order. Return the combinations in lexicographic order, where the first differing value determines ordering. Return an empty list when no combination exists.
Implement find_combinations(denominations, target).
denominations is a list of positive integers.target is a positive integer.target.[2, 3] and [3, 2] are the same combination.def find_combinations(denominations, target):