Solution to String Permutation from Jobdu

24 Aug

Question (in Chinese):

Question Name: String Permutation

Question Description: Give a string, use all the letters of that string to construct all distinct permutations.

Input: the input might contain multiple test cases. Each line contains a string as a test case. All tests have length less than 10. And they may contain duplicate letters.

Output: For each test case, print all the distinct permutations in lexicographical order.

The solution is:

Leave a Reply

Your email address will not be published. Required fields are marked *