Given two strings, determine if they share a common substring. A substring may be as small as one character.
For example, the words "a", "and", "art" share the common substring . The words "be" and "cat" do not share a substring.
Complete the function twoStrings in the editor below. It should return a string, either YES or NO based on whether the strings share a common substring.
twoStrings has the following parameter(s):
The first line contains a single integer , the number of test cases.
The following pairs of lines are as follows:
For each pair of strings, return YES or NO.
We have pairs to check: