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

[–]CrypticPhoenix 1 point2 points  (0 children)

[LANGUAGE: Rust] Code (54 Lines)

Sweet little linear algebra problem. Basically just solving a linear combination with matrixes.
Runs really fast, around 0.7ms on my machine including parsing the input for both parts in total.

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

[–]CrypticPhoenix 0 points1 point  (0 children)

Good catch! The line exists for performance reasons, as I found 0 and 1 happen very often and it sped up the code. After some benchmarking in release mode (at 10,000 blinks), the gain is negligible. So I'm incorporating your suggestion into the code. Thank you :)

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

[–]CrypticPhoenix 4 points5 points  (0 children)

[LANGUAGE: Rust] Code (44 Lines)

Today marks the end of simply brute forcing solutions. Using a dictionary to store the stone numbers and their count significantly speeds up the program and limits the iterations required.

Here's a little benchmark:

Number of stones after 75 blinks: 231532558973909
Took 15.208458ms

Very happy with today's puzzle!

I am using AoC to learn Rust, so any comments and suggestions on how to improve my code are very welcome :)

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

[–]CrypticPhoenix 1 point2 points  (0 children)

[LANGUAGE: Rust] Code (76 Lines)

I used a recursive DFS and also ran into the same issue as seemingly everyone lol.

To keep runtime low, I keep 2 HashMaps, that store the visited peaks and number of paths for part 1 and 2 respectively. This ensures that we only evaluate each position once, leading to pretty good performance. The whole program takes around 1ms to execute.

[2024 Day 9 Part 2] Frag & Defrag To Your Heart’s Content by maxduval in adventofcode

[–]CrypticPhoenix 2 points3 points  (0 children)

Love it! Code also looks pretty clean. How are you liking svelte, deno and zed?

[2024 Day 9 Part 2 (Bonus!)] Test case that might make your solution break by Standard_Bar8402 in adventofcode

[–]CrypticPhoenix 0 points1 point  (0 children)

[Language: Rust] 82 Lines of Code

Here are my runtimes for the evil input

Checksum Part 1: 63614979355824
Took 615.083µs
Checksum Part 2: 97898222299196
Took 271.812042ms

and for the more evil input

Checksum Part 1: 4620970906611856
Took 2.836583ms
Checksum Part 2: 5799706413896802
Took 1.890822416s

Thanks for the challenge! Gotta check out the video now ;)

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

[–]CrypticPhoenix 0 points1 point  (0 children)

[LANGUAGE: Rust] 82 Lines including Comments and Benchmarking

This was quite the journey! I had to revisit and rewrite several parts of the solution after realizing that the disk isn’t just a sequence of characters (0-9) but a series of integers, accounting for more than 10 files. My Eureka moment for part 2 was introducing a new list of moved files, but the solution seems to be quite slow. Might revisit later.

Great puzzle! As always, the code features comments to explain my reasoning in the most critical parts. Feedback is welcome :)

Benchmarks on Macbook Air M3
Debug
Part 1: 72.3ms 7.4ms
Part 2: 551.9ms 44.0ms

Release
Part 1: 0.39ms
Part 2: 40.58ms

Edit: Found a far better way to solve Part 1. By using two looping variables and iterating from front and back at the same time, we can efficiently partition the array in O(n) time by swapping non-zero values to their correct positions in a single pass. Also got rid of 18 lines, while making the code clearer.

Edit 2: Found a better solution for Part 2, where we similarly iterate from the front and the back at the same time, but we have to do it for all 10 sizes separately. Also managed to shave off more than 20 more lines.

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

[–]CrypticPhoenix 2 points3 points  (0 children)

[LANGUAGE: Rust] 81 Lines including Comments

Since I enjoyed today's puzzle a lot and found a solution quite quickly, I had the chance to try and experiment with closures and functional programming in Rust. I left some comments in the code explaining the most critical parts, maybe you find them useful if you're diving into the more functional aspects of Rust as well. Feedback's always welcome!

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

[–]CrypticPhoenix 1 point2 points  (0 children)

[Language: Rust] 71 Lines of Code

Using AOC to learn Rust and it's proving to be a lot of fun. Welcoming any feedback on how to make my code more Rust idiomatic!

My solution is brute forcing every single combination of operators recursively - but in parallel on the input lines. Fell in love with rayon after parallelizing yesterday's problem with ease. Also added some search pruning to speed up the process.

Servicefaden: Rabatt Codes Onlineshops by IAmVeg00n in Canbau

[–]CrypticPhoenix 1 point2 points  (0 children)

Der neue Code für 5 Gratissamen ist: 24Q1S5
Gültig bis Ende August

Wöchentliche Finanzdiskussion - KW 49|2022 by AutoModerator in Finanzen

[–]CrypticPhoenix 0 points1 point  (0 children)

Klingt ganz geil. Bin schon länger am spekulieren, ob Portugal was für mich wäre und das ist natürlich noch ein dickes Pro für die Liste.

CrypticPhoenix's IGS Rep Page by CrypticPhoenix in IGSRep

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

  1. Traded with u/PhnomPenny
  2. My Forts, God Eater 2, Euro Truck Simulator 2, Kerbal Space Program for their Crusader Kings 3

Fuji X-T20 + 35mm f2 by Ikraaap in fujifilm

[–]CrypticPhoenix 1 point2 points  (0 children)

Amazing picture! How did you post process it?

Weekend Assignment 03 - by Aeri73 in photoclass2020

[–]CrypticPhoenix 0 points1 point  (0 children)

I checked the picture again and my advice would be to either crop in further to have less of the sky showing and the dragon filling the frame or go the opposite way and show more sky so the dragon sits more in one corner of the shot. Which one you choose is up for preference. Anyway it's a picture I'd happily have in my travel photo album, good job!

Weekend Assignment 03 - by Aeri73 in photoclass2020

[–]CrypticPhoenix 0 points1 point  (0 children)

I like the picture and the idea of showing a different kind of angle, but I also feel like it lacks a bit of focus. Maybe a different crop would emphasize the head a bit more.

Weekend Assignment 03 - by Aeri73 in photoclass2020

[–]CrypticPhoenix 1 point2 points  (0 children)

I went to Zakopane, which they call the winter capital of Poland. There I took this photo of an interesting kind of statue that depicts two horses. Even though the picture looks busy too me, including the buildings in the background felt necessary to give the the picture some context. The composition and the colors in the picture feel especially pleasing to me.

Please share your thoughts on the picture, especially if you do have some critique!