Last active
April 22, 2016 19:41
-
-
Save mhlangagc/da160892dbf1def50189eb9ba59af787 to your computer and use it in GitHub Desktop.
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
func twoStrings(stringA: String, stringB: String) -> String { | |
let firstSet = Set(stringA.lowercaseString.characters) | |
let secondSet = Set(stringB.lowercaseString.characters) | |
if firstSet.intersect(secondSet).count > 0 { | |
return "YES" | |
} else { | |
return "NO" | |
} | |
} | |
let test = Int(readLine()!) | |
for var i = 0; i < test; i+=1 { | |
let string1 = String(readLine()!) | |
let string2 = String(readLine()!) | |
print(twoStrings(string1, stringB: string2)) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment