diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-15 21:55:28 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-15 21:55:28 +0100 |
commit | 7ce938ea4d40e9a631bfe11795f3d9f74855ceb5 (patch) | |
tree | 2ce00c913332b378ebc1b7a5a8d9d3504a4a8734 /aoc-2022-dotnet/Day12 | |
parent | 6fc820cd0cb61a4bacda5f5b40c98dda850d75da (diff) | |
download | gleam_aoc2020-7ce938ea4d40e9a631bfe11795f3d9f74855ceb5.tar.gz gleam_aoc2020-7ce938ea4d40e9a631bfe11795f3d9f74855ceb5.zip |
Finish day 14
Diffstat (limited to 'aoc-2022-dotnet/Day12')
-rw-r--r-- | aoc-2022-dotnet/Day12/Program.fs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/aoc-2022-dotnet/Day12/Program.fs b/aoc-2022-dotnet/Day12/Program.fs index 0ccaab7..ca827ba 100644 --- a/aoc-2022-dotnet/Day12/Program.fs +++ b/aoc-2022-dotnet/Day12/Program.fs @@ -57,11 +57,8 @@ type Graph<'T> = Some(depth) else bfsExplore - (neighbours - |> Seq.choose (fun n -> - match Set.contains n explored with - | true -> None - | false -> Some(n, depth + 1)) + (neighbours - explored + |> Seq.map (fun n -> (n, depth + 1)) |> Seq.append qt |> List.ofSeq) (explored + neighbours)) |