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