Simplify a little
This commit is contained in:
parent
8cb3c32aa5
commit
eed66a163e
@ -18,8 +18,7 @@ let
|
||||
|
||||
# calc overlaps
|
||||
hasOverlap = overlapFunc: a: b:
|
||||
let a1 = head a; b1 = head b; a2 = last a; b2 = last b;
|
||||
in overlapFunc a1 a2 b1 b2 || overlapFunc b1 b2 a1 a2;
|
||||
splitPair (splitPair overlapFunc a) b || splitPair (splitPair overlapFunc b) a;
|
||||
overlaps = overlapFunc: map boolToInt (map (splitPair (hasOverlap overlapFunc)) pairs);
|
||||
in {
|
||||
part1 = sum (overlaps completeOverlap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user