Given a string return all possible permutations that can be made by rearranging the letters in the string using a queue. For example given "abc" return "abc,acb,bac,bca,cab,cba".
In this problem, we need to implement a recursive function. We declare an array called ans and a variable num to record the beautiful permutations found so far. The cur array represents the array we ...