Piotr Czajkowski 3 years ago
parent
commit
b5bb671768
1 changed files with 3 additions and 4 deletions
  1. 3 4
      day19/day19.go

+ 3 - 4
day19/day19.go

@@ -151,12 +151,11 @@ func part2(max int) int {
 	valid := 0
 	thirtyOne := buildStringsForRule(31, []string{""})
 	fortyTwo := buildStringsForRule(42, []string{""})
-	length31 := len(thirtyOne[0])
-	length42 := len(fortyTwo[0])
+	length := len(thirtyOne[0])
 
-	currentLength := length31 + 2*length42
+	currentLength := 3 * length
 	for len(notMatched) > 0 && currentLength <= max {
-		currentLength += length31
+		currentLength += length
 		var toCheck []string
 
 		for _, message := range notMatched {