Skip to content
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

Add AOC 2024 day2 part2, day3, day4, day5 #68

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lacy108
Copy link

@lacy108 lacy108 commented Feb 7, 2025

No description provided.

Copy link
Contributor

@IsaacFleetwood IsaacFleetwood left a comment

Choose a reason for hiding this comment

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

Looking over it, the runtimes for all the algorithms look good, and everything passes.
There is a single console.log that we would want to remove before committing.

Aswell, I feel the specialization of the UDFs could be decreased (e.g. the udf.reduce function in day3-2). However, I would believe it is fine to merge for now, and revisit later.

arrMid: (arr) => arr[Math.floor(arr.length / 2)],
slice: a => array => array.slice(a),
customSort: (rules, arr) => {
console.log(arr)
Copy link
Contributor

Choose a reason for hiding this comment

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

Before pulling into the upstream repo, could we get rid debug print statement removed?

Copy link
Author

Choose a reason for hiding this comment

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

Done

MAMMMXMMMM
MXMXAXMASX`;
let match = rh`.input | udf.matchAll "(mul\\\\((\\\\d{1,3}),(\\\\d{1,3})\\\\)|do\\\\(\\\\)|don't\\\\(\\\\))" "g"`
let query = rh`udf.reduce ${match}`
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me as though essentially almost all of this problem is done inside this udf.
We can commit it for now, but I think it would be beneficial to come back and try to rewrite it moreso in rhyme.

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.

2 participants