assSolution:""" @param S: The set of numbers. @return: A list of lists. See example. """defsubset_helper(self,result,solution,nums):result.append(solution[:])fori,elinenumerate(nums):solution.append(el)self.subset_helper(result,solution,nums[i+1:])solution.pop()returndefsubsets(self,S):# write your code hereresult=[]self.subset_helper(result,[],sorted(S))returnresult