Palindrome Permutation

Given a string, determine if a permutation of the string could form a palindrome.

Example

Example 1:

Input:
"code"
Output:
 false

Example 2:

Input:
"aab"
Output:
 true

Example 3:

Input:
"carerac"
Output:
 true

Note

计数一下吧,count最后是0或者1。1对应一个单独在最中间,且长度会一定是奇数

Code

打印所有的结果,需要用DFS了

一样判断,然后使用permutation去两边加reverse和不reverse的结果

Last updated