Solution for 99 haskell problem. http://www.haskell.org/haskellwiki/99_questions/