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