Created
March 11, 2015 04:12
-
-
Save nikalras/3ec1f822da7247ba9767 to your computer and use it in GitHub Desktop.
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
import sys | |
def pali(l): | |
dic ={} | |
for i in l: | |
dic[i] = dic[i] +1 if i in dic else 1 | |
out = [ v % 2 for v in dic.values()] | |
return sum(out)<=1 and 'YES' or 'NO' | |
sys.stdout.write( pali(sys.stdin.readline())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment