diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-12-23 21:48:57 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-12-23 21:48:57 +0100 |
commit | 0d9dd1ad91df0c33612e412b94ca94306043b694 (patch) | |
tree | 0efdb0fb16c7d44fd2915ddab96a22228ded1d86 /2019 | |
parent | 381f6eefb3becaee8da4a3f9900c4b4e90abb355 (diff) |
Similarly fix day 20
Diffstat (limited to '2019')
-rw-r--r-- | 2019/20.hs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -23,7 +23,9 @@ shortestPath nextf heuristic startnode target = go 0 (Set.singleton (heuristic s visited' = Map.insert node dist visited in if node == target then dist - else go (ctr + 1) pqueue' visited' + else if maybe True (dist <) (Map.lookup node visited) + then go (ctr + 1) pqueue' visited' + else go (ctr + 1) newpqueue visited main :: IO () main = do |