Return every different arrangement (permutation) of the characters of s, as strings, in alphabetical (lexicographic) order. If s has repeated characters, an arrangement that looks the same must be listed only once.
Example 1
Input:
distinct_permutations('abc')
Output:
['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
Example 2
Input:
distinct_permutations('aab')
Output:
['aab', 'aba', 'baa']
0 <= len(s) <= 8s contains only lower-case letters.No results yet
Run your code to check it against the examples, or submit to run every test.