From ecbf7b27be05dc242f066e681dbe22c4274834f5 Mon Sep 17 00:00:00 2001
From: Andreas Grois <andi@grois.info>
Date: Sat, 9 Dec 2023 16:34:30 +0100
Subject: Day 8 Part 2

---
 Day3.lean | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'Day3.lean')

diff --git a/Day3.lean b/Day3.lean
index e15e205..fbc9e3e 100644
--- a/Day3.lean
+++ b/Day3.lean
@@ -106,7 +106,7 @@ def part2 (schematic : Schematic) : Nat :=
     Lean.HashMap.ofList $ schematic.numbers.bind $ λ pn ↦ pn.positions.map (·, pn)
   let gearSymbols := schematic.parts.filter (Part.symbol · == '*')
   -- but the symbols aren't enough, they need to be adjacent to **exactly** 2 numbers
-  let numbersNextGearSymbols := List.dedup <$> gearSymbols.map λgs ↦
+  let numbersNextGearSymbols := List.eraseReps <$> gearSymbols.map λgs ↦
     gs.position.adjacents.filterMap numberCoordinates.find?
   let gearSymbols := numbersNextGearSymbols.filter (List.length · == 2)
   let gearRatios := gearSymbols.map $ List.foldl (· * PartNumber.value ·) 1
-- 
cgit v1.2.3

