83
SOLUTION MEGATHREAD-🎄- 2022 Day 6 Solutions -🎄-(self.adventofcode)
submitted 3 years, 1 month ago* (edited 4 hours, 17 minutes after) by daggerdragon to /r/adventofcode (134.8k)
- All of our rules, FAQs, resources, etc. are in our community wiki.
- A reque...
since 3 years, 1 month ago
3 of 3
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


Ruby
Nice!
If you care about performance, you might consider using find_index instead of calling looping twice in both
findandindex. If you choose to do that, you might also want to leave batches as an enumerable, rather than converting it to an array.Ooh, I really like that! I seem to be learning about new Enumerable methods every day during AOC. Thanks for sharing that. :)
Refactored solution: https://github.com/nithinbekal/advent-of-code/blob/c3788728010d8bcacd1d622996ef56226ba0370a/lib/06.rb