Skip to content

Commit

Permalink
refactor: add minor optimization improvement to day 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashky committed Dec 7, 2024
1 parent 0cb6c2b commit bb5cdc5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/adventofcode/flashk/day07/Equation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit bb5cdc5

Please sign in to comment.