Skip to main content
5 of 6
deleted 242 characters in body
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 11 bytes

Ẇ;Ɲw@Ƈ¥ÐḟṪL

Try it online!

How?

Ẇ;Ɲw@Ƈ¥ÐḟṪL - Link: A, B
Ẇ           - sublists of A (from shortest to longest)
       Ðḟ   - filter discard those for which:
      ¥     -   last two links as a dyad, f(substringOfA, B):
 ;Ɲ         -     length 2 sublists of substringOfA
     Ƈ      -     keep those (pairs) for which:
   w@       -       is this pair a sublist of B?
         Ṫ  - tail -> longest uncommon substring
          L - length
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282