What are the specifics to this question? Are we asked to find the subset with number of elements k from a superset of size n, that has the largest sum? ... should just sort the set and sum the largest k elements. O(whatever you choose, if you know the range and its small, counting sort, otherwise nlogn)