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

Day3b 164b #8

Merged
merged 1 commit into from
Dec 20, 2022
Merged

Day3b 164b #8

merged 1 commit into from
Dec 20, 2022

Conversation

JoepdeJong
Copy link
Collaborator

No description provided.

@xem xem merged commit 450a14f into xem:main Dec 20, 2022
@xem
Copy link
Owner

xem commented Dec 20, 2022

I fixed your day 3 part 2 (and other stuff) in my last commit, your solution was outputting an array instead of a number

@JoepdeJong
Copy link
Collaborator Author

👍
I had some ideas for 3b. Maybe we can use something like .slice(k * 2, (k + 1) * 2) to loop over parts of i, instead of keeping track of an array in the reducer.

@xem
Copy link
Owner

xem commented Dec 20, 2022

yeah, could be nice. on my side I'm looking for a regex or other approach that can find a character that is present exactly thrice in a string (the concatenation of 3 lines of each group).

@xem
Copy link
Owner

xem commented Dec 20, 2022

I think I have something, but a bit long:

"aaacbebcddcdddeeeae".split``.sort().join``.replace(/(.)\1\1\1+/g,"").match(/(.)\1\1/)[1] // returns "c" 

@JoepdeJong JoepdeJong mentioned this pull request Dec 20, 2022
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.

None yet

2 participants