10267. Palindrome Permutation II

Given a string txt, return a list of all its distinct palindromic arrangements. If it is not possible to form any palindromic arrangement, return an empty list. Output should be sorted in ascending order lexicographically.

Examples

Example 1:
Input: "noon"
Output: ["noon", "onno"]

Example 2:
Input: "abcde"
Output: []

Constraints

  • 1 ≤ txt.length ≤ 20
  • txt consists of lowercase English letters only.




Please use Laptop/Desktop or any other large screen to add/edit code.