Longest Awesome Substring

Find the length of the longest substring that can be rearranged into a palindrome. A string can be rearranged into a palindrome if at most one character appears an odd number of times.

Examples
Input: "ababa"
Output: 5
Hints

Longest Awesome Substring

Find the length of the longest substring that can be rearranged into a palindrome. A string can be rearranged into a palindrome if at most one character appears an odd number of times.