You are given a string. Your task is to generate all possible permutations of the characters. A permutation is formed by rearranging the characters in every possible order. Return all permutations of the string.
Example 1
Input: s = "a"
Output: a
Explanation: Only one arrangement is possible.
Example 2
Input: s = "ab"
Output: ab ba
Explanation: The two characters can be arranged in two different ways.
Example 3
Input: s = "abc"
Output: abc acb bac bca cab cba
Explanation: All possible orderings of the three characters are generated.
Sign in to write, run, and submit your solution against the full test suite.