Skip to content

Instantly share code, notes, and snippets.

@bonipart
Created February 11, 2012 15:56
Show Gist options
  • Save bonipart/1801279 to your computer and use it in GitHub Desktop.
Save bonipart/1801279 to your computer and use it in GitHub Desktop.
Problem 3 of 3, embed.ly challenge
main = print ((length . takeWhile( <= wordCount/2) . scanl1 (+) $ uniqueWords) +1)
where
uniqueWords = map (\x -> 2520 / x) [1..900] --list of unique word frequencies
wordCount = sum uniqueWords --total number of words in text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment