Skip to content

Instantly share code, notes, and snippets.

@mfandl
Created November 24, 2017 08:22
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 mfandl/f709704b78baef645145d1e02e3160cd to your computer and use it in GitHub Desktop.
Save mfandl/f709704b78baef645145d1e02e3160cd to your computer and use it in GitHub Desktop.
import Data.List
lookAndSay :: [Int] -> [Int]
lookAndSay = foldr fn [] . group
where fn x acc = length x : head x : acc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment