Skip to content

Instantly share code, notes, and snippets.

@5outh
Created August 5, 2012 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5outh/3265911 to your computer and use it in GitHub Desktop.
Save 5outh/3265911 to your computer and use it in GitHub Desktop.
Code Golf
import Data.List
import System.Environment
f=concat.r
r []=[[]]
r s=(scanr(:)[]s):(r$init s)
g [a,b]=snd.maximum.map(\x->(length x,x))$intersect(f a)(f b)
main=getArgs>>= \z-> print.g$z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment