Palindrome Permutation
Problem statement
Given a string s, return whether its characters can be rearranged into a palindrome. Use every character exactly once.
A palindrome reads the same forwards and backwards. The empty string is considered a palindrome.
Function
canPermutePalindrome(s: String) → booleanExamples
Example 1
s = "aabbc"return = trueThe characters can form abcba.
Example 2
s = "daily"return = falseMore than one character has an odd frequency.
Example 3
s = "civic"return = trueThe supplied string is already a palindrome, so a valid rearrangement exists.
Constraints
0 <= s.length <= 5000.scontains lowercase English letters only.