Last active
April 6, 2016 15:18
-
-
Save evolutionxbox/4b15ce698989728339831f5678faf05c to your computer and use it in GitHub Desktop.
Given a string `s`, determine whether or not it is possible to rearrange the letters in the string to make a palindrome. (Post manual "uglify")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CanMakePalindrome = (s, b, o, t) => { | |
t = s.length % 2; | |
o = [...s].filter(l => { | |
b = s.split(l); | |
s = b.join``; | |
return (b.length - 1)%2; | |
}); | |
return t ? (o.length === 1) : (o.length === 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment