Implements Sum of Subsets algorithm