diff --git a/solutions/03.ts b/solutions/03.ts index 22a9845..3ec544b 100644 --- a/solutions/03.ts +++ b/solutions/03.ts @@ -26,7 +26,7 @@ class DayThree implements Solvable { public part2(): Solvable { const re = /(mul\([0-9]{1,3},[0-9]{1,3}\)|do\(\)|don\'t\(\))/g - const instructions = this.input.replace('\n', '').trim().matchAll(new RegExp(re)).map(match => match[0]) + const instructions = this.input.matchAll(new RegExp(re)).map(match => match[0]) let active = true let result = 0 for (const inst of instructions) {