Prechádzať zdrojové kódy

Probably won't brute force it

Piotr Czajkowski 2 dní pred
rodič
commit
7d2b35e949
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  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)
 	}