package
1.6.6
Repository: https://github.com/awesee/leetcode.git
Documentation: pkg.go.dev

# README

< Previous                  Next >

266. Palindrome Permutation (Easy)

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

Related Topics

[Bit Manipulation] [Hash Table] [String]

Similar Questions

  1. Longest Palindromic Substring (Medium)
  2. Valid Anagram (Easy)
  3. Palindrome Permutation II (Medium)
  4. Longest Palindrome (Easy)

Hints

Hint 1 Consider the palindromes of odd vs even length. What difference do you notice?
Hint 2 Count the frequency of each character.
Hint 3 If each character occurs even number of times, then it must be a palindrome. How about character which occurs odd number of times?