[LeetCode 267] Palindrome Permutation II
Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form.
For example:
Given s = "aabb", return ["abba", "baab"]
.
Given s = "abc", return []
.
Hint:
- If a palindromic permutation exists, we just need to generate the first half of the string.
- To generate all distinct permutations of a (half of) string, use a similar approach from: Permutations II or Next Permutation.
DiffcultyMedium
Similar Problems
[LeetCode 31] Next Permutation Medium
[LeetCode 46] Permutations Medium
[LeetCode 47] Permutations II Medium
[LeetCode 266] Palindrome Permutation Easy