Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 20, 2024
1 parent 69cc795 commit e324c38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solutions/src/2024/20.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ main =
let open = amap ('#' /=) input
start : _ = [p | (p,'S') <- assocs input]
end : _ = [p | (p,'E') <- assocs input]
optimals = search open end
(os,o:_) = break (\(p,_) -> p == start) (search open end) -- take up to and including the start
cheats = [ d
| (p1,c1) : more <- tails optimals
| (p1,c1) : more <- tails (o:os)
, (p2,c2) <- more
, let d = manhattan p1 p2, d <= 20
, abs (c1 - c2) >= 100 + d
Expand Down

0 comments on commit e324c38

Please sign in to comment.