Quant Memo
Coding/●●●●●

Can these letters be rearranged into a palindrome?

Given a string, decide whether its characters can be reordered into a palindrome. You are free to permute the letters any way you like.

"carerac"  -> True    # e.g. "racecar"
"aabb"     -> True    # e.g. "abba"
"abc"      -> False

Return a boolean in O(n)O(n) time. You do not need to produce the palindrome, only decide if one exists.

Show a hint

In a finished palindrome, walk from both ends inward: characters pair up. How many characters are allowed to be left unpaired in the middle?

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions