Created
May 31, 2016 21:36
-
-
Save jjst/e6fe91711217eaafc02bd9c4eec95a4f to your computer and use it in GitHub Desktop.
This file contains 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
# Solution for https://www.hackerrank.com/challenges/game-of-throne-ii | |
from collections import Counter | |
from math import factorial as f | |
word = raw_input() | |
letter_count = [i/2 for i in Counter(word).values()] | |
print (f(sum(letter_count)) / (reduce(lambda acc, x: acc * f(x), letter_count, 1))) % (10**9 + 7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment