Franco Calvo
francocalvo.bsky.social
Franco Calvo
@francocalvo.bsky.social
Data Engineer @ Draftea
I came up with the idea of counting corners quickly, so "easy" in that regard. But implementing it? Hard and buggy :/
December 12, 2024 at 11:09 PM
I mean't it wasn't hard.
I just rewrote my idea with clear names instead of convulted offsets and it came out ok...
December 12, 2024 at 10:53 PM
I just took the problem representation, created a struct for group and length, and reordered it :)
Inserting and keeping an index isn't fun, huh?
December 11, 2024 at 2:24 AM
AoC 2024 - Day 6
Parsing time: 993.583µs
Part 1 took: 896.542µs
Part 2 took: 766.808708ms
Total time: 767.838667ms
Visited: 4580
Loops: 1480
December 8, 2024 at 5:20 PM
Yeah, excellent. It's really not *that* different from what I did! I implemented a very hacky and inefficient sort function.

I don't know why the word 'sort' didn't make me think of using the std sort function. I'm just learning Go with AoC 😅
December 5, 2024 at 5:50 PM
Also, good idea on sorting the update first and checking after. It would reduce one pass over the input.
December 5, 2024 at 5:47 PM
Hey! I love that your are making blogs for the solutions. Is the 1ms for the complete input, or the sample test input?
December 5, 2024 at 5:42 PM
I know I could've done it a bit differently, moving the conflicting item one cell before the conditioning cell without changing the later. This would've save me a few cycles.
December 5, 2024 at 4:15 PM
What I did for part two was:
1. Create three aux data structures to hold the incremental results.
2. When I found an issue, I switched values (X|Y to Y|X) for the conflicting parts, and resumed computing from lower position.
I had the partial results, so I didn't need to restart for each change.
December 5, 2024 at 4:14 PM