Skip to main content
added 273 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 11 11 10  9 bytes

-1 using ovs's observation.

Ẇ;Ɲw@Ƈ¥ÐḟṪL;Ɲẇ€ṣ1ẈṀ‘

Try it online!Try it online!


10 byter

Ẇ;ƝẇƇ¥ÐḟṪL

Try it online!

How?

Ẇ;Ɲw@Ƈ¥ÐḟṪLẆ;ƝẇƇ¥ÐḟṪ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

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

Jelly,  11 10  9 bytes

-1 using ovs's observation.

;Ɲẇ€ṣ1ẈṀ‘

Try it online!


10 byter

Ẇ;ƝẇƇ¥ÐḟṪL

Try it online!

How?

Ẇ;ƝẇƇ¥ÐḟṪ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:
          -       is this pair a sublist of B?
        Ṫ  - tail -> longest uncommon substring
         L - length
deleted 242 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly,  11  811 bytes

-3 using ovs's observation!

;Ɲw@€TIṀ

Try it online!


11 byter

Ẇ;Ɲ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

Jelly,  11  8 bytes

-3 using ovs's observation!

;Ɲw@€TIṀ

Try it online!


11 byter

Ẇ;Ɲ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

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
Rollback to Revision 2
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 11 11  8 bytes

-3 using ovs's observation!

;Ɲw@€TIṀ

Try it online!


11 byter

Ẇ;Ɲ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

Jelly, 11 bytes

Ẇ;Ɲw@Ƈ¥ÐḟṪL

Try it online!

Jelly,  11  8 bytes

-3 using ovs's observation!

;Ɲw@€TIṀ

Try it online!


11 byter

Ẇ;Ɲ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
Rollback to Revision 1
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 470 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading