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