Skip to content

docs: day07 day08 itsjoeoui #759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/2024/puzzles/day07.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def parse(input: String): Seq[(Long, List[Long])] =
```

### Part 1

To find the equations that could possibly be true we iterate over the equations and check each of them using a recursive
`checkEquation` function. Its input is the test value and the list of numbers and its return value is a boolean.
In each iteration we have two choices, either we use the `*` operator, or we use the `+` operator.
Expand Down Expand Up @@ -60,6 +61,7 @@ end part1
```

### Part 2

In this part a new concatenation operator `||` is added that combines the digits from its left and right inputs into a
single number, for this we expand the `checkEquation` function with a case that does exactly that. We use `toString` on
the two numbers, concatenate them using `++` and then apply `toLong`, concatenate with the remaining numbers and call
Expand Down Expand Up @@ -105,6 +107,7 @@ end part2
- [Solution](https://github.com/profunctor-optics/advent-2024/blob/main/src/main/scala/advent2024/Day07.scala) by [Georgi Krastev](https://github.com/joroKr21)
- [Solution](https://github.com/jportway/advent2024/blob/master/src/main/scala/Day7.scala) by [Joshua Portway](https://github.com/jportway)
- [Solution](https://github.com/TheDrawingCoder-Gamer/adventofcode2024/blob/master/src/main/scala/day7.sc) by [Bulby](https://github.com/TheDrawingCoder-Gamer)
- [Solution](https://github.com/itsjoeoui/aoc2024/blob/main/src/day07.scala) by [itsjoeoui](https://github.com/itsjoeoui)

Share your solution to the Scala community by editing this page.
You can even write the whole article! [See here for the expected format](https://github.com/scalacenter/scala-advent-of-code/discussions/424)
7 changes: 4 additions & 3 deletions docs/2024/puzzles/day08.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ https://adventofcode.com/2024/day/8
## Solution summary

1. Parse the map to identify the locations of all the antennae,
grouped by their frequency.
grouped by their frequency.
2. Find all the antinode locations within the map boundary.
3. Count the number of distinct antinodes.

Expand All @@ -37,7 +37,7 @@ case class AntennaMap(

#### Location

A location is an *x, y* pair along with some helpers for location
A location is an _x, y_ pair along with some helpers for location
arithmetic and range checking.

```scala 3
Expand Down Expand Up @@ -130,8 +130,8 @@ def part2(input: String): String =
end part2
```


## Solutions from the community

- [Solution](https://github.com/nikiforo/aoc24/blob/main/src/main/scala/io/github/nikiforo/aoc24/D8T2.scala) by [Artem Nikiforov](https://github.com/nikiforo)
- [Solution](https://github.com/rmarbeck/advent2024/blob/main/day8/src/main/scala/Solution.scala) by [Raphaël Marbeck](https://github.com/rmarbeck)
- [Solution](https://github.com/fthomas/aoc24/blob/main/src/main/scala/Day08.scala) by [Frank Thomas](https://github.com/fthomas)
Expand All @@ -146,6 +146,7 @@ end part2
- [Solution](https://github.com/merlinorg/aoc2024/blob/main/src/main/scala/Day8.scala) by [merlinorg](https://github.com/merlinorg)
- [Solution](https://github.com/Philippus/adventofcode/blob/main/src/main/scala/adventofcode2024/Day08.scala) by [Philippus Baalman](https://github.com/philippus)
- [Solution](https://github.com/TheDrawingCoder-Gamer/adventofcode2024/blob/master/src/main/scala/day8.sc) by [Bulby](https://github.com/TheDrawingCoder-Gamer)
- [Solution](https://github.com/itsjoeoui/aoc2024/blob/main/src/day08.scala) by [itsjoeoui](https://github.com/itsjoeoui)

Share your solution to the Scala community by editing this page.
You can even write the whole article! [See here for the expected format](https://github.com/scalacenter/scala-advent-of-code/discussions/424)