• + 0 comments

    short solution:

    def twoStrings(s1, s2):
        # Write your code here
        myset = set()
        flag = 'NO'
        
        for i in range(len(s1)):
            myset.add(s1[i])
    
        for i in range(len(s2)):
            if s2[i] in myset:
                flag = 'YES'
                break
    
        return flag