Piotr Czajkowski 22 hours ago
parent
commit
4fda2d8c8c
1 changed files with 2 additions and 4 deletions
  1. 2 4
      20/code.go

+ 2 - 4
20/code.go

@@ -118,14 +118,12 @@ func part1(start *Point, matrix [][]byte, atLeast int) int {
 	savings := make(map[int]int)
 	for {
 		score := hike(start, matrix, xMax, yMax, true, cheats)
-		if score >= 1000000000 {
+		if score >= bestWithoutCheating {
 			break
 		}
 
 		saving := bestWithoutCheating - score
-		if saving == 0 {
-			break
-		} else if saving >= atLeast {
+		if saving >= atLeast {
 			count++
 		}
 		savings[saving]++