less than 1 minute read

Given a string s, determine whether any anagram of s is a palindrome.

Constraints

  • n ≤ 100,000 where n is the length of s

https://binarysearch.com/problems/Palindromic-Anagram

Examples

Example 1

Input

  • s = carrace

Output

  • answer = True

Explanation

"carrace" should return true, since it can be rearranged to form "racecar", which is a palindrome.

Solution

Leave a comment