Junior
Palindrome Permutation
Given a string s, determine if some permutation of s can form a palindrome.
A palindrome reads the same forward and backward. Return true if at least one rearrangement of the characters in s is a palindrome; otherwise, return false.
Example 1
Input
s = "code"Output
falseThe characters in
code cannot be rearranged so that at most one character has an odd count.Example 2
Input
s = "aab"Output
trueThe string can be rearranged as
aba, which is a palindrome.Constraints
- 1 <= s.length <= 5000
- s consists of lowercase English letters.