Skip to main content
Commonmark migration
Source Link

#Pyth, 14 10 bytes

Pyth, 14 10 bytes

[email protected] 

Accepts input as lowercase strings. Try it online here.

[email protected] Implicit: .z=input as list of strings, G=lowercase alphabet m G Map each letter in G, as d, using: L .z In each string in .z ... @ d ... keep only those characters which match d S Sort by length e Take the last element (i.e. longest) s Concatenate into string, implicit print 

Edit: golfed 3 bytes. Previous version: sm*[email protected]

#Pyth, 14 10 bytes

[email protected] 

Accepts input as lowercase strings. Try it online here.

[email protected] Implicit: .z=input as list of strings, G=lowercase alphabet m G Map each letter in G, as d, using: L .z In each string in .z ... @ d ... keep only those characters which match d S Sort by length e Take the last element (i.e. longest) s Concatenate into string, implicit print 

Edit: golfed 3 bytes. Previous version: sm*[email protected]

Pyth, 14 10 bytes

[email protected] 

Accepts input as lowercase strings. Try it online here.

[email protected] Implicit: .z=input as list of strings, G=lowercase alphabet m G Map each letter in G, as d, using: L .z In each string in .z ... @ d ... keep only those characters which match d S Sort by length e Take the last element (i.e. longest) s Concatenate into string, implicit print 

Edit: golfed 3 bytes. Previous version: sm*[email protected]

Saved 3 bytes
Source Link
Sok
  • 6.2k
  • 1
  • 19
  • 30

#Pyth, 1414 10 bytes

sm*deSml@dksmeS@Ld.zG 

Accepts input as lowercase strings. Try it online herehere.

sm*deSml@dksmeS@Ld.zG Implicit: .z=input as list of strings, G=lowercase alphabet m  G Map each letter in G, as d, using:   m L .z MapIn each string in the input, as k,.z using:...   @ d @dk ... keep only Keepthose characters of k which are equal tomatch d   l S TakeSort theby length of the above   eS e Take max of the above (endlast ofelement Sorted(i.e. listlongest) *d Repeat d the above number of times s  Concatenate into string, implicit print 

Edit: golfed 3 bytes. Previous version: sm*[email protected]

#Pyth, 14 bytes

sm*deSml@dk.zG 

Accepts input as lowercase strings. Try it online here.

sm*deSml@dk.zG Implicit: z=input as list of strings, G=lowercase alphabet m  G Map each letter in G, as d, using:   m  .z Map each string in the input, as k, using:   @dk Keep characters of k which are equal to d   l Take the length of the above   eS Take max of the above (end of Sorted list) *d Repeat d the above number of times s  Concatenate into string, implicit print 

#Pyth, 14 10 bytes

smeS@Ld.zG 

Accepts input as lowercase strings. Try it online here.

smeS@Ld.zG Implicit: .z=input as list of strings, G=lowercase alphabet m G Map each letter in G, as d, using: L .z In each string in .z ... @ d ... keep only those characters which match d S Sort by length e Take the last element (i.e. longest) s Concatenate into string, implicit print 

Edit: golfed 3 bytes. Previous version: sm*[email protected]

Source Link
Sok
  • 6.2k
  • 1
  • 19
  • 30

#Pyth, 14 bytes

sm*[email protected] 

Accepts input as lowercase strings. Try it online here.

sm*[email protected] Implicit: z=input as list of strings, G=lowercase alphabet m G Map each letter in G, as d, using: m .z Map each string in the input, as k, using: @dk Keep characters of k which are equal to d l Take the length of the above eS Take max of the above (end of Sorted list) *d Repeat d the above number of times s Concatenate into string, implicit print