Modified the solution of Subsets.