This website works better with JavaScript.
Home
Explore
Help
Sign In
titouan
/
hackerrank
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Solved Gamed Of Thrones 1
main
Titouan Rigoudy
11 years ago
parent
d178fa815c
commit
d4c6b19c75
1 changed files
with
20 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+20
-0
game_of_thrones_1/game_of_thrones_1.py
+ 20
- 0
game_of_thrones_1/game_of_thrones_1.py
View File
@ -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
(
)
Write
Preview
Loading…
Cancel
Save