浏览代码

Probably won't brute force it

Piotr Czajkowski 2 天之前
父节点
当前提交
7d2b35e949
共有 1 个文件被更改,包括 1 次插入1 次删除
  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)
 	}