input: Write a python function to generate all permutations of a given string.
  assert set(permutation(['a', 'b', 'c'], '')) == {'abc', 'acb', 'bac', 'bca', 'cab', 'cba'}
  assert set(permutation(['1', '2', '3'], '')) == {'123', '132', '213', '231', '312', '321'}
  assert set(permutation(['x', 'y'], '')) == {'xy', 'yx'}
output: def permutation(lst, prefix):
      if not lst:
          return [prefix]
      res = []
      for i in range(len(lst)):
          res += permutation(lst[:i] + lst[i+1:], prefix + lst[i])
      return res