-
Notifications
You must be signed in to change notification settings - Fork 88
Blog Post Day 5 2025 #888
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
Blog Post Day 5 2025 #888
Conversation
|
I requested reviewers on Discord, I suggest merging on Monday if there are no blockers by then |
I don't think this deals with unions at all. I think this is meant to say difference? |
Kevincav
left a comment
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.
Nice setup, I like the simplicity.
docs/2025/puzzles/day05.md
Outdated
|
|
||
| Part 2 is a lot more complicated, but I've done [much worse](https://adventofcode.com/2021/day/22), so it wasn't too bad. | ||
|
|
||
| My common library has implementations for ranges that can intersect and combine with each other, but I'll reimplement them here |
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.
I'm a little curious, why implement a new range over NumericRange?
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.
NumericRange throws if your range is larger than the int limit - will add explanation to docs
| ```scala | ||
| type Input = (List[LRange], List[Long]) | ||
|
|
||
| final case class LRange(start: Long, end: Long): |
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.
I wonder if you should be excluding this from the file, then just use a common library that you import, and describe the logic there. I also understand having all logic in one file so you don't need prior knowledge (or dig into another file), but it would be cleaner.
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.
The blog post format requires we only use scala 3 standard library and include any and all code in the result
docs/2025/puzzles/day05.md
Outdated
| // toIterator to prevent Set from deduplicating our result | ||
| combinedRanges.toIterator.map(_.size).sum |
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.
Thanks for the writeup, I think it's written well! Minor nitpick: I believe .toIterator has been deprecated since 2.13, and should be replaced with .iterator instead.
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.
it has???? will fix that
|
I still want to do some work on the linked Diet sample so can you hold off on merging until I'm ready? |
|
alright no complaints from me anymore |
|
thanks all! |
No description provided.