Created
October 28, 2019 14:34
-
-
Save imedadel/a6d0a42c94105d03e722756eb4a97db1 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
| pairs = int(input()) | |
| from collections import Counter | |
| def checkPairs(first, second): | |
| firstCount = Counter(first) | |
| secondCount = Counter(second) | |
| commonLettersExist = firstCount - secondCount != firstCount | |
| if commonLettersExist: | |
| return "YES" | |
| else: | |
| return "NO" | |
| while(pairs > 0): | |
| pairs -= 1 | |
| firstWordLetters = [letter for letter in input().strip()] | |
| secondWordLetters = [letter for letter in input().strip()] | |
| print(checkPairs(firstWordLetters, secondWordLetters)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment