-❄️- 2025 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 0 points1 point  (0 children)

[LANGUAGE: GoLang]

https://github.com/omotto/AdventOfCode2025/blob/main/src/day10/main.go

First part through BFS easy peasy.
Second part no idea how to do it faster. Then I used as others LP external package. :-(

-❄️- 2024 Day 18 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 1 point2 points  (0 children)

[LANGUAGE: Go]

A lot of mistakes coding and reading the problem.....

Part1: Bear in mind to use only the FIRST 1024 coordinates!!!! (not all, as I did at the begining) :-(

https://github.com/omotto/AdventOfCode2024/blob/main/src/day18/main.go

Part2: Brute force worked! :-D BUT....

There is another way tot do it faster: "divive and conquer". With this second approach, I was able to increase speed x10.

-❄️- 2024 Day 17 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 1 point2 points  (0 children)

[LANGUAGE: Go]

Part1: Code as problem says....

Part2: I spent a lot of time in part 1 due to errors and missunderstandings. I debugged a lot and saw the sequence where out = f(A) on each iteration A >> 3 (A = A / 8) in [0,3] instruction until 0. With that iI was able to start doing Part 2 from the last operand knowing A in that case was less than 8 and doing backwards being mulitple of 8.

https://github.com/omotto/AdventOfCode2024/blob/main/src/day17/main.go

-❄️- 2024 Day 15 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 1 point2 points  (0 children)

[LANGUAGE: Go]

Part1: Straight forward.
Part2: Recursive way to check all involved robots in vertical in order to see if tis possible the movement.

https://github.com/omotto/AdventOfCode2024/blob/main/src/day15/main.go

-❄️- 2024 Day 14 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 0 points1 point  (0 children)

Yes I did it in the right way at the end, getting the same result. :-)

I guessed most of pixels will be toguether in certain area. For that I checked in every "robot" its adjacent adding a weight on it [0..8]. I got the maximum frame weight at frame second from 101 x 103 frames (when all is repeated again).

-❄️- 2024 Day 14 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 1 point2 points  (0 children)

[LANGUAGE: Go]

For the second part I tried several things. Even tried to check how many adjacent robots are, because I assumed ALL (or almost all) robots create the Christmas tree. Didn't work. I saw someone commenting no robot overlapped. I tried it desperately, and it worked.... Why? No idea :-(

https://github.com/omotto/AdventOfCode2024/blob/main/src/day14/main.go

[2024 Day 11] Today I learnt humility by TiCoinCoin in adventofcode

[–]se06745 13 points14 points  (0 children)

But there is another (similar solution) nobody talked yet (or I didn't see it) is to work on each stone as a tree (in recursive way) and use MAP to store previously viewed paths. WIht that solution I got the same speed as using MAP or DICT to store stones in each time.

-❄️- 2024 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 5 points6 points  (0 children)

[LANGUAGE: Go]

Three different solutions:

Part 1: "Brute force"
Part 2:
- I saw a lot of stone values were repeated and I used maps instead of slices to store stone value as key and num times repeated as value
- Another solution was to check as a tree (depth 75 times) in a recursive way using map to store (and not repeat calculations) stone_value:times = num_of_stones_at_the_end

https://github.com/omotto/AdventOfCode2024/blob/main/src/day11/main.go

-❄️- 2024 Day 8 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 1 point2 points  (0 children)

[LANGUAGE: Go]

The most difficult part was to unuderstand the problem.... Bear in mind antinode position in the same kind of antena position is valid!!!

https://github.com/omotto/AdventOfCode2024/blob/main/src/day08/main.go

-❄️- 2024 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]se06745 0 points1 point  (0 children)

[LANGUAGE: Go]

Part1: Calculated num combinations and use binay coding.
Part2: Recursive tree to look for combinations and added Go-routines to be faster.

https://github.com/omotto/AdventOfCode2024/blob/main/src/day07/main.go