File tree Expand file tree Collapse file tree 1 file changed +16
-17
lines changed Expand file tree Collapse file tree 1 file changed +16
-17
lines changed Original file line number Diff line number Diff line change 33open Common
44open System
55
6- module p1 =
7- let solve ( input : List < string >) =
8- input
9- |> Seq.map ( fun s ->
10- if (( String.IsNullOrWhiteSpace >> not ) s) then
11- Some( int64 s)
12- else
13- None)
14- |> Seq.fold
15- ( fun acc cal ->
16- let ( c , s ) = acc
6+ let p1 ( input : List < string >) =
7+ input
8+ |> Seq.map ( fun s ->
9+ if (( String.IsNullOrWhiteSpace >> not ) s) then
10+ Some( int64 s)
11+ else
12+ None)
13+ |> Seq.fold
14+ ( fun acc cal ->
15+ let ( c , s ) = acc
1716
18- match cal with
19- | Some v -> ( c + v, max ( c + v) s)
20- | None -> ( 0 L, s))
21- ( 0 , 0 )
22- |> snd
17+ match cal with
18+ | Some v -> ( c + v, max ( c + v) s)
19+ | None -> ( 0 L, s))
20+ ( 0 , 0 )
21+ |> snd
2322
2423let input = Common.readIn
25- input |> p1.solve |> Common.writeOut
24+ input |> p1 |> Common.writeOut
You can’t perform that action at this time.
0 commit comments