Skip to content

Instantly share code, notes, and snippets.

@orclev
Last active September 27, 2016 17:45
Show Gist options
  • Save orclev/39afeb06df13d81ac482d31501ec23fc to your computer and use it in GitHub Desktop.
Save orclev/39afeb06df13d81ac482d31501ec23fc to your computer and use it in GitHub Desktop.
import Data.Set (fromList, intersection, size)
import Data.List (foldl1, map)
process :: String -> String
process = show . size . foldl1 intersection . map fromList . lines
main :: IO ()
main = interact process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment