File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/main/scala/eu/sim642/adventofcode2025 Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -117,13 +117,13 @@ object Day10 {
117117 */
118118
119119 override def fewestPresses (machine : Machine ): Int = {
120- val zeroCol = machine.joltages.map(_ => 0L )
120+ val zeroCol = machine.joltages.map(_ => 0 )
121121 val rows =
122122 machine.buttons
123- .map(_.foldLeft(zeroCol)(_.updated(_, 1L )))
123+ .map(_.foldLeft(zeroCol)(_.updated(_, 1 )))
124124 .transpose
125125
126- val sol = GaussianElimination .solve(rows, machine.joltages.map(_.toLong) )
126+ val sol = GaussianElimination .solve(rows, machine.joltages)
127127 // val mSum = m.transpose.map(_.sum) // TODO: use?
128128
129129 def helper (freeMaxs : List [Int ]): Iterator [List [Int ]] = freeMaxs match { // TODO: this seems like it should exist from earlier somewhere
@@ -140,10 +140,10 @@ object Day10 {
140140 val dependentMaxs = sol.dependentVars.map(maxs)
141141 (for {
142142 freeVals <- helper(freeMaxs.toList)
143- dependentVals = sol.evaluate(freeVals.map(_.toLong) )
143+ dependentVals = sol.evaluate(freeVals)
144144 if dependentVals.forall(_ >= 0 )
145145 if (dependentVals lazyZip dependentMaxs).forall(_ <= _)
146- } yield dependentVals.sum.toInt + freeVals.sum).min
146+ } yield dependentVals.sum + freeVals.sum).min
147147 }
148148 }
149149
You can’t perform that action at this time.
0 commit comments