From 5e13267baaa454b228bfa9bd7361d2ed0784539f Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Sat, 3 Dec 2022 12:21:32 +0100 Subject: Remove redundant function parameter --- aoc-2022-dotnet/Day03/Program.fs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'aoc-2022-dotnet') diff --git a/aoc-2022-dotnet/Day03/Program.fs b/aoc-2022-dotnet/Day03/Program.fs index 1bf2235..f62d906 100644 --- a/aoc-2022-dotnet/Day03/Program.fs +++ b/aoc-2022-dotnet/Day03/Program.fs @@ -12,9 +12,8 @@ let cutInHalf xs = let half = Seq.length xs / 2 [ Seq.take half xs; Seq.skip half xs ] -let solution1 input = - input - |> Seq.sumBy ( +let solution1 = + Seq.sumBy ( cutInHalf >> Seq.map Set >> Set.intersectMany @@ -22,10 +21,9 @@ let solution1 input = >> priority ) -let solution2 input = - input - |> Seq.chunkBySize 3 - |> Seq.sumBy ( +let solution2 = + Seq.chunkBySize 3 + >> Seq.sumBy ( Seq.map Set >> Set.intersectMany >> Seq.exactlyOne -- cgit v1.2.3