-
Notifications
You must be signed in to change notification settings - Fork 88
docs(2025): day 06 writeup #896
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
base: website
Are you sure you want to change the base?
Conversation
a1b88a5 to
f8467de
Compare
|
let's merge on Tuesday, to give time for review feedback (which I've asked for on Discord) |
docs/2025/puzzles/day06.md
Outdated
|
|
||
| ```scala | ||
| extension (xs: IterableOnce[(symbol: String, nums: IterableOnce[String])]) | ||
| inline def calculate: Long = xs.iterator.collect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline probably unnecessary
docs/2025/puzzles/day06.md
Outdated
| Let's define an [extension method](https://docs.scala-lang.org/scala3/reference/contextual/extension-methods.html) to improve readability. | ||
|
|
||
| ```scala | ||
| extension (xs: IterableOnce[(symbol: String, nums: IterableOnce[String])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this takes an xs: Iterator[...] it'll be more apparent how it connects, plus...
docs/2025/puzzles/day06.md
Outdated
| ```scala | ||
| def part2(input: String): Long = | ||
| val lines = input.linesIterator.toVector | ||
| val ops = lines.last.split(raw"\s+").toVector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can then be .iterator instead of toVector and then it's just (ops zip xss).calculate which removes the lazyZip complexity. My reasoning being that you chose to make ops a Vector, so the efficiency you speak of is for an inefficiency that is a bit self-imposed.
Just a suggestion to reduce some extraneous things.
else LGTM.
|
@scarf005 can you respond to the review feedback, please? |
76f020e to
7f346a6
Compare
|
@SethTisue @merlinorg applied in |
Co-authored-by: merlin <merlin@merlin.org>
7f346a6 to
bcdcdc4
Compare
Co-authored-by: Merlin Hughes <merlin@merlin.org>
No description provided.