← 返回 databricks 的题目列表Find All Possible Permutations
类型:online_judge
Given a string s, find all possible permutations of its characters and return them as a list, sorted in lexicographical order. Implement a function find_permutations(s: str) -> List[str].
Input
A string s (1 <= len(s) <= 8), consisting of lowercase English letters.
Output
A list containing all possible permutations, sorted in lexicographical order.
Example
Example 1:
Input: "abc" Output: ["abc", "acb", "bac", "bca", "cab", "cba"]
Example 2:
Input: "a" Output: ["a"]
Example
Input
abc