267 Palindrome Permutation II
1. Question
Given a strings
, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form.
For example:
Givens = "aabb"
, return["abba", "baab"]
.
Givens = "abc"
, return[]
.
2. Implementation
(1) Backtracking
3. Time & Space Complexity
Backtracking: 时间复杂度O((n/2)!), 空间复杂度O(n), 递归的深度最多为n/2
Last updated