EDIT: I've realized my question is a variant of the knapsack problem, only instead of maximum price and weight <= target, minimum price and length >= target. I'll try figuring it out and post an answer once I do.
Given an array of items, where each item has two properties - price and value, I need to find the cheapest combination (lowest total price) whose total value is greater than or equal to a target value.
An item may be chosen multiple times.
items = [{id:"a", v:10, p:8}, {id:"b", v:25, p:15}, {id:"c", v:45, p:20}]
target = 60
result = ["c","a"]
Any help would be greatly appreciated! Thanks!