code: def subsets(nums):
      
      n = len(nums)
      total = 1 << n
      res = set()
  
      for i in range(total):
          subset = tuple(num for j, num in enumerate(nums) if i & 1 << j)
          res.add(subset)
  
      return res
docs: :param nums: List[int]
      :return: Set[tuple]