blob: 55616013ca4d5f05d5784e399483298c78dc956b (
plain) (
tree)
|
|
module Solutions.Day1
open System.IO
let lines = File.ReadLines("inputs/day1.txt")
let totalWeights = seq {
let mutable subseq = 0
for line in lines do
if line.Equals("") then
yield subseq
subseq <- 0
else
subseq <- subseq + int line
}
let part1 () = totalWeights |> Seq.max
let part2 () = totalWeights |> Seq.sortDescending |> Seq.take 3 |> Seq.sum
|