Possible Palindrome

Published by Helen Yu in

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

Watch a quick demo on how Edabit works.