Browse Source

Solved part2

Piotr Czajkowski 2 weeks ago
parent
commit
2888b37dd5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      03/code.go

+ 1 - 1
03/code.go

@@ -58,11 +58,11 @@ func part2(lines []string) int {
 		for reading {
 		for reading {
 			if multiply {
 			if multiply {
 				index := strings.Index(line, "don't()")
 				index := strings.Index(line, "don't()")
-				multiply = false
 				if index == -1 {
 				if index == -1 {
 					endIndex = len(line)
 					endIndex = len(line)
 					reading = false
 					reading = false
 				} else {
 				} else {
+					multiply = false
 					endIndex = index
 					endIndex = index
 				}
 				}