From 7ce938ea4d40e9a631bfe11795f3d9f74855ceb5 Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Thu, 15 Dec 2022 21:55:28 +0100 Subject: Finish day 14 --- aoc-2022-dotnet/Day12/Program.fs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'aoc-2022-dotnet/Day12') 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)) -- cgit v1.2.3