diff options
| author | Andreas Grois <andi@grois.info> | 2024-12-22 23:23:13 +0100 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2024-12-22 23:23:13 +0100 |
| commit | bbf615a66d1814ff196313b206cd3bcc239079c1 (patch) | |
| tree | 6b0be787b5f46103e6226bf5f44154ca3b45c818 /Day17.lean | |
| parent | 46b7edb98dd6677fc3924e48f775acc14a65a149 (diff) | |
Complete Day 17 Part 1
Diffstat (limited to 'Day17.lean')
| -rw-r--r-- | Day17.lean | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -389,6 +389,18 @@ decreasing_by have : closedSet.size < (Finite.cardinality (ClosedSetEntry heatLossMap)) := Std.HashSet.size_lt_finite_cardinality_of_not_mem closedSet ⟨_,h₂⟩ omega +def part1 (heatLossMap : HeatLossMap) : Option Nat := + heatLossMap.findPath (OpenSet.start heatLossMap) Std.HashSet.empty + +------------------------------------------------------------------------------------ + +open DayPart +instance : Parse ⟨17, by simp⟩ (ι := HeatLossMap) where + parse := (Except.mapError ToString.toString) ∘ parse + +instance : Part ⟨17,_⟩ Parts.One (ι := HeatLossMap) (ρ := Nat) where + run := part1 + ------------------------------------------------------------------------------------ private def testData := "2413432311323 |
