Skip to content

Commit 1a38628

Browse files
committed
remove indices
1 parent 71ed0ad commit 1a38628

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2022/src/day16.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def bestPath(map: RoomsInfo, start: Id, valves: Set[Id], timeAllowed: Int): Int
114114
// we are finished when we no longer have time to reach another valve or all valves are open
115115
val routesOfCurrent = map.routes(current)
116116
var bestValue = totalValue
117-
for index <- valvesLookup.indices do
117+
for index <- 0 to valveCount do
118118
if valveIndexLeft(index) then
119119
val id = valvesLookup(index)
120120
val distance = routesOfCurrent(id)

0 commit comments

Comments
 (0)