Last active
August 21, 2021 10:18
-
-
Save azurast/8d36bd91b733d881c6c764ff13665559 to your computer and use it in GitHub Desktop.
Swift solution to the Hackkerrank Two Strings problem - First Attempt
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
/* | |
First Attempt | |
5/8 test cases passed | |
*/ | |
func twoStrings(s1: String, s2: String) -> String { | |
for char in s2 { | |
if s1.contains(char) { | |
return "YES" | |
} | |
} | |
return "NO" | |
} | |
twoStrings(s1: "hello", s2: "world") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment