Piotr Czajkowski 2 years ago
parent
commit
67456cc453
1 changed files with 1 additions and 1 deletions
  1. 1 1
      01/code.go

+ 1 - 1
01/code.go

@@ -47,7 +47,7 @@ func part2(input []int) []int {
 	var measurements []int
 	index := 0
 	for i, value := range input {
-		if len(input[i:]) > 2 {
+		if i+2 < len(input) {
 			measurements = append(measurements, value)
 			measurements[index] += input[i+1]
 			measurements[index] += input[i+2]