Implement the subset generation problem.