• + 0 comments

    for Python3 Platform

    def twoStrings(s1, s2):
        for i in s1:
            if (i in s2):
                return "YES"
        else:
            return "NO"
    
    p = int(input())
    for j in range(p):
        s1 = input()
        s2 = input()
        
        result = twoStrings(s1, s2)
        
        print(result)