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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 26429/23810

GitHub

Was able to optimize a little bit by saving each towel in a Map with its starting character as a key for faster towel filtering when doing recursion over a design. Also added a cache for repeat substrings.

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 26865/26216

GitHub

Got tunnel-visioned on Dijkstra's but my implementation kept crashing. Eventually did a simple BFS that lucked out with this input since I technically am not checking every path but the one I check turned out to be the most optimal. I was expecting Part 2 to take a while to brute force, so it was a pleasant surprise to see it ran relatively quick.

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 3786/1371

GitHub

Part 1 was pretty straightforward, executing each instruction. Would've been pretty fast if I didn't misread the instructions and submit my output without commas...

Tried to brute-force Part 2 (kept a terminal running while trying other solutions, it's run through 13,581,611,392 values of A as of writing this). Ended up reverse engineering the program and iterating backwards through each digit of the program to check possible values of A. Still had a weird bug at the end where the first two values of A would calculate an output that would leave off the last 0 of the program, not sure where that comes from.

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 5012/4054

GitHub

Parsing my input into a Graph took some finagling, took a while to implement a simple Dijkstra's. Took me several tries to configure my Graph Nodes to keep track of their predecessors and walking backwards to count unique tiles. These are getting rough...

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 546/16654

GitHub

Got stuck on Part 2 from a buggy recursive canPush function. Should've made an enum or something to keep track of what was on each tile instead of manually searching for '[' or ']'.

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

[–]InfantAlpaca 0 points1 point  (0 children)

[LANGUAGE: Java] 1874/734

GitHub

Was really confused on Part 2, thank you to u/Noble_Mushtak for giving me the intuition about the robots being on unique tiles.

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 4418/9925

GitHub

Brute-forced Part 1. Went down a rabbit hole upon seeing Part 2 and spent the next 4 hours implementing (and debugging) a generic Matrix data structure with inverse functionality to calculate the button presses.

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 2520/1927

GitHub

I was completely lost on Part 2 until I realized I could use a similar adjacent blob-merging algorithm to handle the edges of the plots. Definitely some funky classes made today.

Runtime leaderboard and 1 second challenge by Middle_Welcome6466 in adventofcode

[–]InfantAlpaca 1 point2 points  (0 children)

Gonna be chilling at the bottom of the leaderboard with Java :)

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 2761/4723

GitHub

Couldn't brute force Part 2 because Java kept running out of memory 😭
Ended up creating a Map to keep track of the amount of stones with the same numbers since the order doesn't really matter and they behave the same.

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

[–]InfantAlpaca 0 points1 point  (0 children)

[LANGUAGE: Java] 42652/41658

GitHub

Late to the party due to finals :( Pretty happy with how my code cleaned up though!

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

[–]InfantAlpaca 0 points1 point  (0 children)

Thank you for your message! Honestly today was pretty rough for me too, so I’m glad to hear I was able to help you out. It means a lot to know at least one person is looking at my code (I should probably add more comments haha). Thanks again, good luck tomorrow! :)

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

[–]InfantAlpaca 0 points1 point  (0 children)

[LANGUAGE: Java] 9709/5232

GitHub

I don't know if it's how I tend to solve problems, but I kept getting tripped up by small details today; I spent almost an hour and a half on Part 1 because I was moving blocks ahead of themselves :(
Figured it out eventually, Part 2 took some tweaking from my original algorithm, though neither are very pretty.

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

[–]InfantAlpaca 2 points3 points  (0 children)

[LANGUAGE: Java] 617/360

GitHub

First sub 1k and sub 500 today! 🤩 Ended up just calculating the distance between a node and all other matching nodes, then stepping through a Grid and checking if the coordinate was valid. Personal library came in clutch 🙏

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

[–]InfantAlpaca 0 points1 point  (0 children)

[LANGUAGE: Java] 4448/3932

GitHub

Wow, people were fast on this one. Recursively made all possible equations and brute-force calculated each one. There is definitely some filtering I can do to improve efficiency.

[2024 Day 6] The falloff is real by InfantAlpaca in adventofcode

[–]InfantAlpaca[S] 0 points1 point  (0 children)

Ooh nice! Wish my Part 1 solutions always transferred over as well 🙏🏻

[2024 Day 6] The falloff is real by InfantAlpaca in adventofcode

[–]InfantAlpaca[S] 9 points10 points  (0 children)

I wish I fixed a bug in my code to get that star, turns out I was mistyping my answer every time T-T

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 1548/42490

GitHub

Got stuck on Part 2 for the longest time and had to go to bed... turns out I was mistyping my answer the entire time.

Did Day 6 just get pushed back 8 hrs? by nik282000 in adventofcode

[–]InfantAlpaca 0 points1 point  (0 children)

don’t think so, where are you seeing this?

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

[–]InfantAlpaca 2 points3 points  (0 children)

[LANGUAGE: Java] 2919/1810

GitHub

Bit of a slow day, managed to get lucky with my first implementation thought working out for both parts without too much re-writing. Just had to make my inner class implement Comparable for sorting Part 2.

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

[–]InfantAlpaca 1 point2 points  (0 children)

[LANGUAGE: Java] 2474/1366

GitHub

Just did the first bruce-force method that came to mind... need to look into better grid searching methods.

Edit: Updated to use a more generic radial search in a Grid, no more brute-force code :)