fork(1) download
  1. def f(x):l=len;m=filter;y=sorted([''.join(m(str.isalnum,i))for i in x],key=l);*z,=m(l,[''.join(i for i in y if-~j==l(i))for j in range(l(y[-1]))]);y==z and+print(*z,sep='\n')or f(z)
  2. for x in (['This is a sample text,', 'that you will have to use to build stairs.', 'The wood may be of excellent quality,', 'or pretty crappy almost falling apart and filled with termites.', 'Bla bla bla - some more text', 'Ok, that will do'],['A', 'small', 'one', 'that', 'contains', 'equal', 'length', 'strings', 'for', 'the', 'special', 'rule'],['Test,', 'test.', 'This', 'is', 'a', 'test.']):
  3. try:
  4. f(x)
  5. except:
  6. pass
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
Okthatwilldo
Thisisasampletext
Blablablasomemoretext
Thewoodmaybeofexcellentquality
thatyouwillhavetousetobuildstairs
orprettycrappyalmostfallingapartandfilledwithtermites
A
length
oneforthe
smallequal
stringsspecial
thatrulecontains
a
is
TesttestThistest