input: Write a function to generate all permutations of a list.
  assert allPermutations([1, 2, 3]) == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
  assert allPermutations([0, 1]) == [[0, 1], [1, 0]]
  assert allPermutations([1]) == [[1]]
output: def allPermutations(lst):
      if len(lst) == 0:
          return [[]]
      if len(lst) == 1:
          return [lst]
      permutations = []
      for i in range(len(lst)):
          m = lst[i]
          remaining_list = lst[:i] + lst[i+1:]
          for p in allPermutations(remaining_list):
              permutations.append([m] + p)
      return permutations