Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 26, 2023
1 parent 9bf64a6 commit 9857ea3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion solutions/src/2023/25.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ contract combineNodeLabels g
let (l,r) = es !! i -- pick a random edge to contract
(Just (li, _, !szl, lo), g1) = match l g
(Just (ri, _, !szr, ro), g2) = match r g1
adj = [a | a@(_,n) <- li ++ lo ++ ri ++ ro, n /= l, n /= r]
adj = [a | a@(_,n) <- li ++ lo, n /= r]
++ [a | a@(_,n) <- ri ++ ro]
g3 = ([], l, combineNodeLabels szl szr, adj) & g2
contract combineNodeLabels g3

0 comments on commit 9857ea3

Please sign in to comment.