diff --git a/src/main/java/com/adventofcode/flashk/day07/Equation.java b/src/main/java/com/adventofcode/flashk/day07/Equation.java index cb90f99..bbb3a6c 100644 --- a/src/main/java/com/adventofcode/flashk/day07/Equation.java +++ b/src/main/java/com/adventofcode/flashk/day07/Equation.java @@ -30,6 +30,8 @@ private boolean hasSolution(long partialResult) { if(operators.isEmpty()) { return partialResult == result; + } else if(partialResult > result) { + return false; } Integer currentOperator = operators.poll();