Skip to content

Instantly share code, notes, and snippets.

@ChanChar
Created March 14, 2015 19:15
Show Gist options
  • Save ChanChar/34a508fd078b7949ef5a to your computer and use it in GitHub Desktop.
Save ChanChar/34a508fd078b7949ef5a to your computer and use it in GitHub Desktop.
matching words solution
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