input: Write a function to generate all subsets of a given set.
  assert subset([1, 2, 3]) == [[], [3], [2], [2, 3], [1], [1, 3], [1, 2], [1, 2, 3]]
  assert subset([1]) == [[], [1]]
  assert subset([]) == [[]]
output: def subset(s):
      res = [[]]
      for num in s:
          res += [curr + [num] for curr in res]
      return res