Created
March 14, 2015 19:15
-
-
Save ChanChar/34a508fd078b7949ef5a to your computer and use it in GitHub Desktop.
matching words solution
This file contains hidden or 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
words = input().split() | |
repeats = [] | |
for code_word in words: | |
if words.count(code_word) > 1 and code_word not in repeats: | |
repeats.append(code_word) | |
print(" ".join(sorted(repeats))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment