When you reach for the simplest brute force implementaiton... but it takes a realllly long time to run (haven't finished yet :sweat_smile: ). Time for some optimization or something smarter :smiley:
I've got something that is more efficient, and passes for the example input but isn't giving me the right answer. I need to afk now, so figure I may as well share what I have so far. :smiley:
https://github.com/lukewilliamboswell/aoc/blob/main/2024/06.roc
TIMING:
READING INPUT: <1ms
SOLVING PART 1: 5ms
SOLVING PART 2: 4567ms
https://github.com/ostcar/aoc2024/blob/main/day06.roc
part1 in 196.243ms
part2 in 7m29.008s
I don't have any time this weekend. But I have to come back to this and look for a better solution :innocent:
Part 1 done: https://github.com/thenikso/advent-of-code-2024-roc/blob/main/06.roc
this is starting to be quite time consuming :sweat_smile:
Done with part 2:
Day 06 part 1: (Ok 4789) [30ms]
Day 06 part 2: (Ok 1304) [3194ms]
Pretty much brute force worked for me . The only trick I played was in narrowing down the candidates for Part 2.
Part One: 4663 [49 ms].
Part Two: 1530 [387 ms].
Got my Part 1 done just in time. I brute forced this one too, it was a pretty convenient approach. :grinning: https://github.com/robmerrell/aoc2024/blob/main/day6.roc
Finally able to start AOC again after the day 5 epic quest. I hate when you pass the example first try, but not on the real input
This one sucks to debug on the real input is well
Thank god for off-by-one errors
Brut forced but spent already way to much time on it... https://github.com/RobinCamarasa/Advent-of-code/blob/master/2024/day06/RobinCamarasa/main.roc
This took a couple of tries:
SOLVING PART 1: 331ms
SOLVING PART 2: 146388ms
Claude really writing some optimized code for part 2
Last updated: Jul 06 2025 at 12:14 UTC