浏览代码

Still not there

Piotr Czajkowski 1 周之前
父节点
当前提交
0eecb04691
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      08/code.go

+ 13 - 1
08/code.go

@@ -75,6 +75,19 @@ func part1(boxes []box) int {
 		}
 	}
 
+	circuits := make([][]box, circuit)
+	for i := range circuits {
+		circuits[i] = []box{}
+	}
+
+	for _, box := range boxes {
+		circuits[box.circuit] = append(circuits[box.circuit], box)
+	}
+
+	for _, circuit := range circuits {
+		fmt.Println(circuit, len(circuit))
+	}
+
 	return result
 }
 
@@ -91,5 +104,4 @@ func main() {
 
 	boxes := readInput(file)
 	part1(boxes)
-	fmt.Println(boxes)
 }