输入描述:
输入一个字符串,长度不超过9(可能有字符重复),字符只包括大小写字母。
示例1
输入:
"ab"
返回值:
["ab","ba"]
示例2
输入:
"aab"
返回值:
["aab","aba","baa"]
示例3
输入:
"abc"
返回值:
["abc","acb","bac","bca","cab","cba"]
=================================================================================================================================
解题思路:
本题的思路和之前回溯的思想一样,不过更简单的做法是将字符串的每个字符先进行排序,再进行回溯,这样可以方便去除重复的字符串;去重这一部分我还没完全搞懂。。。所以还得多练