Print all permutations in sorted (lexicographic) order
Given a string s, print all unique permutations of the string in lexicographically sorted order. Examples: Input: "ABC"Output: ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]Explanation: All characters are distinct, so there are 3! = 6 unique permutations, printed in sorted order. Input: "AAA"Output: ["A