input: Write a function to generate all permutations of a string.
  assert permute("abc") == ["abc", "acb", "bac", "bca", "cab", "cba"]
  assert permute("a") == ["a"]
  assert permute("ab") == ["ab", "ba"]
  assert permute("xyz") == ["xyz", "xzy", "yxz", "yzx", "zxy", "zyx"]
output: def permute(s):
      def backtrack(path, options):
          if not options:
              result.append(path)
              return
          for i in range(len(options)):
              backtrack(path + options[i], options[:i] + options[i+1:])
  
      result = []
      backtrack("", s)
      return result