Skip to content

Commit

Permalink
feat: remove not needed logic at day 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashky committed Dec 7, 2024
1 parent bb5cdc5 commit 7909e77
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/adventofcode/flashk/day07/Equation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7909e77

Please sign in to comment.