Advertisement
Guest User

Untitled

a guest
Feb 5th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.34 KB | None | 0 0
  1. open System.IO
  2.  
  3. let convertFile =
  4.     File.ReadAllLines("F#/Euler/8-number.txt")
  5.     |> Seq.concat
  6.     |> Seq.map (fun c -> int32(c.ToString()))
  7.  
  8. let calcProduct numbers =
  9.     numbers
  10.     |> Seq.fold (fun acc x -> acc * x) 1
  11.  
  12. let findMax =
  13.     convertFile
  14.     |> Seq.windowed(13)
  15.     |> Seq.map (fun x -> calcProduct x)
  16.     |> Seq.max
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement