Algorithms

Finding subsets with particular sums 11 April 2016 in technical
Given a list L and a sum S, what's the best way to find x, y in L such that x + y = S? What about a set of n integers with that sum, instead of a pair? I don't have a good answer for the second question; suggestions welcome!