input: Write a python function to generate all permutations of a given string.
  assert sorted(permutate("abc")) == sorted(["abc", "acb", "bac", "bca", "cab", "cba"])
  assert sorted(permutate("ab")) == sorted(["ab", "ba"])
  assert sorted(permutate("a")) == sorted(["a"])
output: def permutate(s):
      if len(s) == 1:
          return [s]
      permutations = []
      for i, char in enumerate(s):
          for perm in permutate(s[:i] + s[i+1:]):
              permutations.append(char + perm)
      return permutations