# 266. Palindrome Permutation

**<font color=red>难度: Easy</font>**

## 刷题内容

> 原题连接

* https://leetcode.com/problems/palindrome-permutation/

> 内容描述

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

Example 1:

Input: "code"
Output: false
Example 2:

Input: "aab"
Output: true
Example 3:

Input: "carerac"
Output: true
```

## 解题方案

> 思路 1
******- 时间复杂度: O(N)******- 空间复杂度: O(N)******

数一下只出现奇数次数的字母有多少个，如果少于或者等于1个，都可以组成Palindrome

beats 100%

```python
class Solution:
    def canPermutePalindrome(self, s):
        """
        :type s: str
        :rtype: bool
        """
        tmp = collections.Counter(s)
        res = 0
        for i in tmp.values():
            if i & 1 == 1:
                res += 1
        return res <= 1
```
