From 7909e773cb9241fa0f5999048aec0d8844f0d21a Mon Sep 17 00:00:00 2001 From: Flashk Date: Sat, 7 Dec 2024 09:21:32 +0100 Subject: [PATCH] feat: remove not needed logic at day 7 --- src/main/java/com/adventofcode/flashk/day07/Equation.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/adventofcode/flashk/day07/Equation.java b/src/main/java/com/adventofcode/flashk/day07/Equation.java index bbb3a6c..e443c52 100644 --- a/src/main/java/com/adventofcode/flashk/day07/Equation.java +++ b/src/main/java/com/adventofcode/flashk/day07/Equation.java @@ -37,10 +37,8 @@ private boolean hasSolution(long partialResult) { Integer currentOperator = operators.poll(); boolean hasSolution = hasSolution(partialResult + currentOperator); - if(!hasSolution && partialResult != 0) { + if(!hasSolution) { hasSolution = hasSolution(partialResult * currentOperator); - } else if(partialResult == 0) { - hasSolution = hasSolution(currentOperator); } if(!hasSolution && concatenate) {