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)
 }