Created
October 30, 2015 17:12
-
-
Save r-wheeler/8c78fcf59805a0bed2e9 to your computer and use it in GitHub Desktop.
hackerrank game of thrones
This file contains hidden or 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
from collections import Counter | |
def algo(s): | |
v = len(filter(lambda x: x % 2 == 1, Counter(s).values())) | |
if v <=1: | |
return True | |
else: | |
return False | |
string = raw_input() | |
found = algo(string) | |
# Write the code to find the required palindrome and then assign the variable 'found' a value of True or False | |
if not found: | |
print("NO") | |
else: | |
print("YES") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment