solution for subsets