Let\'s say I have the following code.
var numberToGetTo = 60; var list = new[] {10, 20, 30, 40, 50};
I want to be able to return 50 &
This is an NP-complete problem called the knapsack problem. That means, that your best method is not going to be in polynomial time. You may have to brute-force a solution.