Skip to main content
deleted 109 characters in body
Source Link
emanresu A
  • 44.2k
  • 5
  • 100
  • 240

Vyxal, 1314 bytes

K'2lv∑⁰vca¬;tK'2lv∑⁰vca¬;tL

Try it Online!Try it Online!

A bit messy.

K              # Substrings
 '         ;   # Filtered by...
         a¬    # None of...
  2lv∑         # Substrings of length 2
       vc      # Are contained in...
      ⁰        # The second input
            t  # Get the last (and longest) element
              # This works because K returns the elements in order of shortest to longest
             L # And filtering out elements can'tGet unsortits itlength

Vyxal, 13 bytes

K'2lv∑⁰vca¬;t

Try it Online!

A bit messy.

K             # Substrings
 '         ;  # Filtered by...
         a¬   # None of...
  2lv∑        # Substrings of length 2
       vc     # Are contained in...
      ⁰       # The second input
            t # Get the last (and longest) element
              # This works because K returns the elements in order of shortest to longest
              # And filtering out elements can't unsort it

Vyxal, 14 bytes

K'2lv∑⁰vca¬;tL

Try it Online!

A bit messy.

K              # Substrings
 '         ;   # Filtered by...
         a¬    # None of...
  2lv∑         # Substrings of length 2
       vc      # Are contained in...
      ⁰        # The second input
            t  # Get the last (and longest) element
             L # Get its length
Source Link
emanresu A
  • 44.2k
  • 5
  • 100
  • 240

Vyxal, 13 bytes

K'2lv∑⁰vca¬;t

Try it Online!

A bit messy.

K             # Substrings
 '         ;  # Filtered by...
         a¬   # None of...
  2lv∑        # Substrings of length 2
       vc     # Are contained in...
      ⁰       # The second input
            t # Get the last (and longest) element
              # This works because K returns the elements in order of shortest to longest
              # And filtering out elements can't unsort it