Skip to content

Conversation

@scarf005
Copy link
Contributor

@scarf005 scarf005 commented Dec 6, 2025

No description provided.

@scarf005 scarf005 changed the title docs: blogpost for 2025 day 06 docs(2025): day 06 writeup Dec 6, 2025
@SethTisue
Copy link
Collaborator

let's merge on Tuesday, to give time for review feedback (which I've asked for on Discord)


```scala
extension (xs: IterableOnce[(symbol: String, nums: IterableOnce[String])])
inline def calculate: Long = xs.iterator.collect {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline probably unnecessary

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])])
Copy link
Contributor

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...

```scala
def part2(input: String): Long =
val lines = input.linesIterator.toVector
val ops = lines.last.split(raw"\s+").toVector
Copy link
Contributor

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.

Just a suggestion to reduce some extraneous things.

else LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants