input: Write a python function to generate all permutations of a given string.
  assert set(permutation('ABC')) == {'ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA'}
  assert set(permutation('AB')) == {'AB', 'BA'}
  assert set(permutation('A')) == {'A'}
output: def permutation(s):
      if len(s) == 1:
          return [s]
      perms = []
      for i, char in enumerate(s):
          for perm in permutation(s[:i] + s[i+1:]):
              perms.append(char + perm)
      return perms