dp/subset_sum: simplify algorithm