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