find the sum of largest subset of an array