aboutsummaryrefslogtreecommitdiff
path: root/aoc-2022-dotnet/Day12
diff options
context:
space:
mode:
Diffstat (limited to 'aoc-2022-dotnet/Day12')
-rw-r--r--aoc-2022-dotnet/Day12/Program.fs7
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))