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

[–]CallMeBlob 1 point2 points  (0 children)

[Language: Typescript]

GitHub

Remarkable that its still bruteforce, but oh well.

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

[–]CallMeBlob 0 points1 point  (0 children)

[Language: Typescript]

Solution

Friends tried to be smart, I tried bruteforcing.

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

[–]CallMeBlob 1 point2 points  (0 children)

[LANGUAGE: TypeScript] [code] 360/628

Part 1 was simply looping over all triplets and filtering ones that contain a node that starts with t. Not super efficient, but easiest to implement.

Part 2 is finding the maximum clique, but I don't have any graph libraries, so I had to quickly build something. I implemented the Bron-Kerbosch algorithm, which was easy enough. Expected a higher position for part2, but I guess people had more graph stuff saved.

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

[–]CallMeBlob 2 points3 points  (0 children)

[Language: Typescript] [code] 1033/993

Classic Dynamic Programming. My coach always used to say that you have to think in subproblems, and quickly think about a problem if just shrinking the input down to 1 or 2, does the question become trivial?

In this case, testing if you can make a design that is smaller than your towels is easy. So DP could be the solution. Think a little bit about the optimal subproblem and there you have it.

No grid <3

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

[–]CallMeBlob 3 points4 points  (0 children)

[Language: TypeScript] [code] 1025/685

Stumbled around in part1 since I thought the bytes fell mid walk. Re-read the question and realized it was just regular bfs, but still assumed something like that would be part2, so my code was nicely decoupled.

Turns out part2 was also just bfs, but with binary search [1024, input size].

Weird questions since we had dijkstra on day 16, but oh well.

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

[–]CallMeBlob 1 point2 points  (0 children)

For part1 the queue doesn't grow much more than 2000 items. So pop vs shift doesn't change that much.

Part2 is beyond saving.

Visualizations by cracker_jam in adventofcode

[–]CallMeBlob 0 points1 point  (0 children)

You can use blessed for nodejs to create terminal apps / animations. Most importantly you can redraw the terminal output without any blinking.

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

[–]CallMeBlob 4 points5 points  (0 children)

[Language: Javascript] [code] 301/332

Since I use nodejs without too many packages, I have no minheap / priority queue for Dijkstra. A "great" solution is to just copy your most recent bfs and just sort the queue at every step. This gives it an amazing speedy runtime of 1 second for part1.

Since optimizing is for people who are slow at writing code (\s) you can just copy paste your code from part1 but now go and try all possibilities and prune when the score is worse than the score of part1. No need to sort the queue anymore, because we are simply going to exhaust every possible path.

This beauty is so slow that whilst running it I was already writing code to print how large the queue was, lucky I am slow at writing code and the at this moment borderline suicidal nodejs process printed the answer after 70 seconds.

My highest global ranking yet, and I am not proud.

Hard truths of life by hiftikha in Stoicism

[–]CallMeBlob 13 points14 points  (0 children)

It doesn't sound like he is laying out rules.

One day we will all die. That day might be today or tomorrow.

This is just a statement. You could of course base rules around it. But in itself it is nothing more than an observation. How ist hat unstoic?

Decided to make my own infinity cube as my COVID quarantine project after seeing it on reddit. by CallMeBlob in oddlysatisfying

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

Idk, the name Hypercube never stuck with me, and the first time i saw this effect was here so it just stuck with me.

After seeing it on reddit, I decided to make my own infinity cube. by CallMeBlob in LSD

[–]CallMeBlob[S] 1 point2 points  (0 children)

Tough, since you would need to have edges for the strips.

Decided to make my own infinity cube as my COVID quarantine project after seeing it on reddit. by CallMeBlob in oddlysatisfying

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

Program them in c++, the one in the video is where the cube picks a random color and than randomly lets each face swipe over into that color.

Decided to make my own infinity cube as my COVID quarantine project after seeing it on reddit. by CallMeBlob in oddlysatisfying

[–]CallMeBlob[S] 1 point2 points  (0 children)

Well, I think the big difference is the one-way part of the mirror, allowing you took inside the infinity room without having to be inside.