Created
November 23, 2014 04:25
-
-
Save avamsi/ee5af56652e009dfcda7 to your computer and use it in GitHub Desktop.
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
| def common(a, b): | |
| out = [] | |
| for i in a: | |
| try: | |
| b.remove(i) | |
| out.append(i) | |
| except ValueError: | |
| pass | |
| return sorted(out) | |
| while True: | |
| try: | |
| a = raw_input() | |
| b = raw_input() | |
| except EOFError: | |
| break | |
| print ''.join(common(list(a), list(b))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment