-
-
Save eric-wieser/1668970 to your computer and use it in GitHub Desktop.
One-statement solution for Alphabet Soup
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
(lambda i, o: | |
o.write('\n'.join( | |
'Case #%d: %d' % (n + 1, | |
(lambda str, target: min(str.count(l) / target.count(l) for l in target)) | |
(i.readline(), 'HACKERCUP') | |
) for n in xrange(int(i.readline())) | |
)) | |
)(open('alphabet.in'), open('alphabet.out', 'w')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment