∇ z←validate(a b);l;m;s;subs
→(z←0∊l←≢¨a b)↑0 ⍝ l=lengths, exit if there's 0 among them
m←⌊/l ⍝ lowest length
s←(l⍳m)⊃a b ⍝ get the shortest string
m←⌊m÷2 ⍝ divide by 2
subs←m{(↓⍺,[1.5]⍳(≢⍵)-⍺){⍺[1]↑⍺[2]↓⍵}¨⊂⍵}¨a b ⍝ look for matches of substrings of a in b (and vice versa) ⍝ get substrings (of length m)
z←~1∊∊subs{⍺⍷¨⊂⍵}¨b a ⍝ return 0 if we found any matches
∇
Here's a solution in Dyalog APL:
Running it:
But don't take my word for it - Try It Online!