Given two strings, determine if they share a common substring. A substring may be as small as one character.
These share the common substring .
These do not share a substring.
Complete the function twoStrings in the editor below.
twoStrings has the following parameter(s):
- string s1: a string
- string s2: another string
- string: either
The first line contains a single integer , the number of test cases.
The following pairs of lines are as follows:
- The first line contains string .
- The second line contains string .
- and consist of characters in the range ascii[a-z].
For each pair of strings, return
2 hello world hi world
We have pairs to check:
- , . The substrings and are common to both strings.
- , . and share no common substrings.