Skip to content

Instantly share code, notes, and snippets.

@r-wheeler
Created October 30, 2015 17:12
Show Gist options
  • Save r-wheeler/8c78fcf59805a0bed2e9 to your computer and use it in GitHub Desktop.
Save r-wheeler/8c78fcf59805a0bed2e9 to your computer and use it in GitHub Desktop.
hackerrank game of thrones
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