memorize the double-room check on day two
This commit is contained in:
parent
6fe9d251bd
commit
c2a087abf7
@ -77,7 +77,8 @@ func descend(rooms map[string]room, currentRoom string, path []string, success c
|
|||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func(link string, path []string) {
|
go func(link string, path []string) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
descend(rooms, link, path, success, canVisitSmallRoomTwice)
|
// in day 2, skip checks once we know we've visited a small room twice
|
||||||
|
descend(rooms, link, path, success, canVisitSmallRoomTwice && !doubleSmallAlready(newPath))
|
||||||
}(link, newPath)
|
}(link, newPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user