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