Problem 40
The 40th problem of the project_euler can be solved by taking advantage of the Haskell laziness. As one can see below, I defined an infinite list inf_lst, which contains all positive integers in a string format. As I said, since Haskell is lazy, it will only compute the list if it needs its values. Therefore, it was only a matter of accessing the 6 required positions in the list and calculate its multiplication:
The execution time is: (0.32 secs, 69247988 bytes)
blog comments powered by Disqus