← Back to challenges

Possible Palindrome

JavaScriptHardstringsregexvalidation

Instructions

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

Examples

possiblePalindrome("acabbaa") ➞ true
// Can make the following palindrome: "aabcbaa"

possiblePalindrome("aacbdbc") ➞ true
// Can make the following palindrome: "abcdcba"

possiblePalindrome("aacbdb") ➞ false

possiblePalindrome("abacbb") ➞ false

Notes

N/A

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