class Solution:
    def subsets(self, nums):
        """
        :type nums: List[int]
        :rtype: List[List[int]]
        """
        # could use DP to optimize
        res = [[]]
        for i, e in enumerate(nums):
            temp = self.subsets(nums[i+1:])
            for t in temp:
                res.append([e] + t)
        return res

e7473573056ddd0d4f3b68fe0bc30771aa4f2228
<mask token>

class Solution:
    <mask token>

class Solution:

    def subsets(self, nums):
        """
        :type nums: List[int]
        :rtype: List[List[int]]
        """
        res = [[]]
        for i, e in enumerate(nums):
            temp = self.subsets(nums[i + 1:])
            for t in temp:
                res.append([e] + t)
        return res

class Solution:
    def subsets(self, nums):
        """
        :type nums: List[int]
        :rtype: List[List[int]]
        """
        # could use DP to optimize
        res = [[]]
        for i, e in enumerate(nums):
            temp = self.subsets(nums[i+1:])
            for t in temp:
                res.append([e] + t)
        return res
