Backend Engineer
Senior
programming
Implement a function that returns all unique permutations of a given string, ensuring that the output is sorted lexicographically. ### Constraints: - Str length from 1 to 8. Each character is a lowercase letter. ### Examples: 1. Input: 'zyx' Output: ['xyz', 'xzy', 'yxz', 'yzx', 'zxy', 'zyx'] 2. Input: 'bca' Output: ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
Suggested Answer