Write a function to generate all permutations of a string.
HardProblem Statement
Write a function to generate all permutations of a string.
Sample Input
abc
Sample Output
['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
Limits
Time: 2s · Memory: 256 MB
Write a function to generate all permutations of a string.
abc
['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
Time: 2s · Memory: 256 MB