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 sounds similar to the Subset sum problem, which can be solved in a reasonable amount of time for smallish sets using dynamic programming. It's not an easy or common problem, so you won't find a helpful Linq extension method for it :)