Posts Tagged ‘challenge’

Programming Praxis – Billboard Challenge, Part 2

June 26, 2012

In today’s Programming Praxis challenge, our goal is to solve the second part of the billboard test, which is to find the fifth group of ten digits of e that sum up to 49. Reusing our definition of stream_e from the previous exercise, the solution becomes a simple one-liner:

main :: IO ()
main = print $ [x | x <- map (take 10) $ tails stream_e, sum x == 49] !! 4