diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-09 19:31:24 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-09 19:31:24 +0100 |
commit | 967e964f453fc031816270b90d6eab38410769a3 (patch) | |
tree | 99ca5504c1be629eb35cda6514df401965d232fd /aoc-2022-dotnet/Day06 | |
parent | fd04f2ebd1a4ade35a3e218b7737311ac631fce8 (diff) | |
download | gleam_aoc2020-967e964f453fc031816270b90d6eab38410769a3.tar.gz gleam_aoc2020-967e964f453fc031816270b90d6eab38410769a3.zip |
Extract common functions to util module
Diffstat (limited to 'aoc-2022-dotnet/Day06')
-rw-r--r-- | aoc-2022-dotnet/Day06/Day06.fsproj | 4 | ||||
-rw-r--r-- | aoc-2022-dotnet/Day06/Program.fs | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/aoc-2022-dotnet/Day06/Day06.fsproj b/aoc-2022-dotnet/Day06/Day06.fsproj index 249287d..e7e4a65 100644 --- a/aoc-2022-dotnet/Day06/Day06.fsproj +++ b/aoc-2022-dotnet/Day06/Day06.fsproj @@ -12,4 +12,8 @@ <Compile Include="Program.fs" /> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Common\Common.fsproj" /> + </ItemGroup> + </Project> diff --git a/aoc-2022-dotnet/Day06/Program.fs b/aoc-2022-dotnet/Day06/Program.fs index c9f6568..78902cd 100644 --- a/aoc-2022-dotnet/Day06/Program.fs +++ b/aoc-2022-dotnet/Day06/Program.fs @@ -1,10 +1,11 @@ module Day06 open System.IO +open Common let solution n = Seq.windowed n - >> Seq.findIndex (Set >> Set.count >> (=) n) + >> Seq.findIndex (Util.countDistinct >> (=) n) >> (+) n assert |