You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To find the equations that could possibly be true we iterate over the equations and check each of them using a recursive
34
35
`checkEquation` function. Its input is the test value and the list of numbers and its return value is a boolean.
35
36
In each iteration we have two choices, either we use the `*` operator, or we use the `+` operator.
@@ -60,6 +61,7 @@ end part1
60
61
```
61
62
62
63
### Part 2
64
+
63
65
In this part a new concatenation operator `||` is added that combines the digits from its left and right inputs into a
64
66
single number, for this we expand the `checkEquation` function with a case that does exactly that. We use `toString` on
65
67
the two numbers, concatenate them using `++` and then apply `toLong`, concatenate with the remaining numbers and call
@@ -105,6 +107,7 @@ end part2
105
107
-[Solution](https://github.com/profunctor-optics/advent-2024/blob/main/src/main/scala/advent2024/Day07.scala) by [Georgi Krastev](https://github.com/joroKr21)
106
108
-[Solution](https://github.com/jportway/advent2024/blob/master/src/main/scala/Day7.scala) by [Joshua Portway](https://github.com/jportway)
107
109
-[Solution](https://github.com/TheDrawingCoder-Gamer/adventofcode2024/blob/master/src/main/scala/day7.sc) by [Bulby](https://github.com/TheDrawingCoder-Gamer)
110
+
-[Solution](https://github.com/itsjoeoui/aoc2024/blob/main/src/day07.scala) by [itsjoeoui](https://github.com/itsjoeoui)
108
111
109
112
Share your solution to the Scala community by editing this page.
110
113
You can even write the whole article! [See here for the expected format](https://github.com/scalacenter/scala-advent-of-code/discussions/424)
-[Solution](https://github.com/nikiforo/aoc24/blob/main/src/main/scala/io/github/nikiforo/aoc24/D8T2.scala) by [Artem Nikiforov](https://github.com/nikiforo)
136
136
-[Solution](https://github.com/rmarbeck/advent2024/blob/main/day8/src/main/scala/Solution.scala) by [Raphaël Marbeck](https://github.com/rmarbeck)
137
137
-[Solution](https://github.com/fthomas/aoc24/blob/main/src/main/scala/Day08.scala) by [Frank Thomas](https://github.com/fthomas)
@@ -146,6 +146,7 @@ end part2
146
146
-[Solution](https://github.com/merlinorg/aoc2024/blob/main/src/main/scala/Day8.scala) by [merlinorg](https://github.com/merlinorg)
147
147
-[Solution](https://github.com/Philippus/adventofcode/blob/main/src/main/scala/adventofcode2024/Day08.scala) by [Philippus Baalman](https://github.com/philippus)
148
148
-[Solution](https://github.com/TheDrawingCoder-Gamer/adventofcode2024/blob/master/src/main/scala/day8.sc) by [Bulby](https://github.com/TheDrawingCoder-Gamer)
149
+
-[Solution](https://github.com/itsjoeoui/aoc2024/blob/main/src/day08.scala) by [itsjoeoui](https://github.com/itsjoeoui)
149
150
150
151
Share your solution to the Scala community by editing this page.
151
152
You can even write the whole article! [See here for the expected format](https://github.com/scalacenter/scala-advent-of-code/discussions/424)
0 commit comments