Solved SubSetsWithDup problem with an iterative method