Solved SubSets problem with an iterative method