Skip to content

Commit f3bfe11

Browse files
committed
1ufs
1 parent 782c0af commit f3bfe11

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

f#/1.fsx

+16-17
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
open Common
44
open 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 -> (0L, s))
21-
(0, 0)
22-
|> snd
17+
match cal with
18+
| Some v -> (c + v, max (c + v) s)
19+
| None -> (0L, s))
20+
(0, 0)
21+
|> snd
2322

2423
let input = Common.readIn
25-
input |> p1.solve |> Common.writeOut
24+
input |> p1 |> Common.writeOut

0 commit comments

Comments
 (0)