Discover Packages
github.com/openset/leetcode
problems
palindrome-permutation
package
Version:
v1.6.5
Opens a new window with list of versions in this module.
Published: Mar 23, 2021
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
< Previous
Next >
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
[Hash Table ]
Similar Questions
Longest Palindromic Substring (Medium)
Valid Anagram (Easy)
Palindrome Permutation II (Medium)
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?
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.