Skip to content

Instantly share code, notes, and snippets.

@nikalras
Created March 11, 2015 04:12
Show Gist options
  • Save nikalras/3ec1f822da7247ba9767 to your computer and use it in GitHub Desktop.
Save nikalras/3ec1f822da7247ba9767 to your computer and use it in GitHub Desktop.
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