Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 265 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

Husk, 8 bytes

ḟȯ=L1LUT

Try it online!

Different approach to the previous Husk answer . Gets the longest prefix with all-unique characters from each index position, and then selects the first that is the same length as the number of input strings.

ḟ # first element that satisfies
 ȯ=L1L # length (of string) equals length of input (array), of
 U # longest prefixes of all unique characters of
 T # transpose of input

Husk, 8 bytes

ḟȯ=L1LUT

Try it online!

ḟ # first element that satisfies
 ȯ=L1L # length (of string) equals length of input (array), of
 U # longest prefixes of all unique characters of
 T # transpose of input

Husk, 8 bytes

ḟȯ=L1LUT

Try it online!

Different approach to the previous Husk answer . Gets the longest prefix with all-unique characters from each index position, and then selects the first that is the same length as the number of input strings.

ḟ # first element that satisfies
 ȯ=L1L # length (of string) equals length of input (array), of
 U # longest prefixes of all unique characters of
 T # transpose of input
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

Husk, 8 bytes

ḟȯ=L1LUT

Try it online!

ḟ # first element that satisfies
 ȯ=L1L # length (of string) equals length of input (array), of
 U # longest prefixes of all unique characters of
 T # transpose of input

AltStyle によって変換されたページ (->オリジナル) /