Browse Source

Probably won't brute force it

Piotr Czajkowski 3 days ago
parent
commit
7d2b35e949
1 changed files with 1 additions and 1 deletions
  1. 1 1
      19/code.go

+ 1 - 1
19/code.go

@@ -118,8 +118,8 @@ func getMax(patterns [][]string) int {
 
 func part2(patterns [][]string, towels []string) int {
 	var count int
+	maxPatterns := getMax(patterns) * 2
 	for _, towel := range towels {
-		maxPatterns := getMax(patterns)
 		checked := make(map[string]int)
 		count += checkTowel2(towel, 0, patterns, checked, maxPatterns)
 	}