You are viewing a single comment's thread. Return to all comments →
Version 1:
def twoStrings(s1, s2): for char in s1: if char in s2: return "YES" return "NO"
Version 2:
def twoStrings(s1, s2): return "YES" if any(char in s2 for char in s1) else "NO"
Version 3:
def twoStrings(s1, s2): return "YES" if set(s1) & set(s2) else "NO"
Seems like cookies are disabled on this browser, please enable them to open this website
Two Strings
You are viewing a single comment's thread. Return to all comments →
Version 1:
Version 2:
Version 3: