← Back to challenges

Possible Palindrome

PythonHardstringsregexvalidation

Instructions

Create a function that determines whether it is possible to build a palindrome from the characters in a string.

Examples

possible_palindrome("acabbaa") ➞ True
# Can make the following palindrome: "aabcbaa"

possible_palindrome("aacbdbc") ➞ True
# Can make the following palindrome: "abcdcba"

possible_palindrome("aacbdb") ➞ False

possible_palindrome("abacbb") ➞ False

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.