From d4c6b19c75b8cb09348e0fc690a955542a05f7ff Mon Sep 17 00:00:00 2001 From: Titouan Rigoudy Date: Sat, 27 Sep 2014 01:25:14 -0400 Subject: [PATCH] Solved Gamed Of Thrones 1 --- game_of_thrones_1/game_of_thrones_1.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 game_of_thrones_1/game_of_thrones_1.py diff --git a/game_of_thrones_1/game_of_thrones_1.py b/game_of_thrones_1/game_of_thrones_1.py new file mode 100644 index 0000000..42a1a38 --- /dev/null +++ b/game_of_thrones_1/game_of_thrones_1.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +# https://www.hackerrank.com/challenges/game-of-thrones + +import sys + +def is_palindrome_anagram(str): + chars = [ False ] * 26 + for c in str: + chars[ord(c) - 97] ^= True + return sum(chars) <= 1 + +def main(): + if is_palindrome_anagram(sys.stdin.readline().strip()): + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main() \ No newline at end of file