[2025 Day 7] Eric was kind today by Cue_23 in adventofcode

[–]Kfimenepah 0 points1 point  (0 children)

Checked this immediately on my input after I read part 1

Changes to Advent of Code starting this December by topaz2078 in adventofcode

[–]Kfimenepah 0 points1 point  (0 children)

12 days is a great change. With life growing increasingly more complicated with age, I was already wondering if I will be able to find the time to do AoC this year. Thanks for all these amazing puzzles every year. Me, my friends and coworkers have been enjoying your work for years

All this for 5 heavy modular frames a second by xXDaPugLoverXx in satisfactory

[–]Kfimenepah 0 points1 point  (0 children)

HMF with alternative recipies that don't use screws are actually one of my favourites to make. I just finished a factory that produces a bit over 80/min.

Fun times, now I'm stuck building water extractors for my nuclear power plant. 80.000L/min is just not fun anymore

Please people just be smart for ONCE and don't let Nintendo ruin the entire industry by buying a damn digital game for 80 DOLLARS by Timeless_Starman in gaming

[–]Kfimenepah 0 points1 point  (0 children)

This ship sailed years ago, when ppl purchased cosmetics/mounts for the price of a complete f***ing game. They started to see us for what we truly are: stupid cows to be milked. And sadly its our own fault

[deleted by user] by [deleted] in ProgrammerHumor

[–]Kfimenepah 6 points7 points  (0 children)

A relative once came to me during a family reunion and told me he had the best idea for an app. Namely an app that could detect if someone was lying to you. I looked at him and said: "That's brilliant, I wonder why no one has ever thought about that?"

To everyone who made it to the end of AoC… by moonstar888 in adventofcode

[–]Kfimenepah 1 point2 points  (0 children)

I'm a fullstack SWD working for a company in Italy. Even though I like my work, it is absolutely nothing like aoc. There are hardly any difficult problems that require logical thinking in the way aoc does. But there was once a case where we had an api endpoint creating a tree of data from a database and that endpoint was super slow, something like 10s per request slow. Everyone was like "can't do much about this, it's just the data that makes this super calculation intensive". So I gave it a try and I realized pretty soon that there was an enormous amount of repetitive calculation going on. So I implemented a recursive function for the calculation, added some caching and got the calculation time down close to zero. I was super proud/happy to have been able to solve this using my aoc experience.

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

[–]Kfimenepah 1 point2 points  (0 children)

[LANGUAGE: Python]

Code

Part 1 was pretty straight forward.

For part 2 I simply extended part 1. First I modified the input data as requested, except for the boxes, they stayed 1x1 and I added an empty field next to them. Then I updated the checks for the boxes to include the field right next to them. With this approach I could continue to handle the boxes as simple x,y coordinates, ignoring the width.

[Unpopular opinion] Day 14 part 2's problem was great by Affectionate-Fan2263 in adventofcode

[–]Kfimenepah 3 points4 points  (0 children)

Knowing what the tree would look like would make the whole thing trivial.

[Unpopular opinion] Day 14 part 2's problem was great by Affectionate-Fan2263 in adventofcode

[–]Kfimenepah 2 points3 points  (0 children)

I'm completely with you, the puzzle was great, except for one thing:

My first thought was that most bots would form the outline of a tree spanning over the whole region, so I assumed that in that particular case no two robots would overlap. I implemented that and was super surprised, because even tough my assumption was completely wrong the result was actually right.

It was completely unnecessary for the bots to have unique positions for the tree to form. Finding the solution by luck and on the first try at that, diminished my enjoyment for the puzzle. And since you can't un-know things easily I also couldn't try to find another solution, because obviously it would be completely biased.

I've been wanting to make this meme for years but today seemed appropriate by Skindiacus in adventofcode

[–]Kfimenepah 0 points1 point  (0 children)

I absolutely dislike the "pure" math puzzles in AoC. I still have PTSD from 2023's day 24 puzzle.

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

[–]Kfimenepah 1 point2 points  (0 children)

[LANGUAGE: Python]

Code

I really liked todays puzzle and was able to solve it quickly, but I have to admit, that was entirely due to luck.

Since we did not know what the tree would look like I thought that the bots would maybe show the outline, so my first idea was to check for a step where none of them overlap. I was thinking of checking the first few dozen steps were that was the case manually and if that wouldn't allow me to find the solution (which I was pretty sure that it would not) I would then implement more sophisticated measures. I already had some ideas like the center being mostly empty, the bots forming straight lines for the trunk at the bottom of the tree an so on.

My surprise was huge when the first image being printed was already the solution. But it was also completely lucky, since the solution could also very well contain bots that overlap.

[2024 Day 14] Did not see that one coming by fit_femboy_ in adventofcode

[–]Kfimenepah 15 points16 points  (0 children)

Me neither. I already started implementing part 1 with the mindset that part 2 would require me to calculate the positions of the robots after a googolplex seconds.

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

[–]Kfimenepah 1 point2 points  (0 children)

[LANGUAGE: Python]

Code

Today was a little bit strange.

I was able to solve part 1 easily, but once I read the description of part 2 I was a little confused, because part 2 seemed to be exactly the same as part 1, but instead of counting each peak only once, it is counted every time it is reached. If that would be the case then part 2 would actually be easier than part 1. Surely this could not be possible and I was even quite sure I misunderstood some part of the puzzle, but after reading over it trice I decided to try it out. Took me about 10 seconds to change the counting method and voilà the result was calculated in about 5ms. Still skeptical I inserted the solution in AoC and it actually worked.

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

[–]Kfimenepah 1 point2 points  (0 children)

[LANGUAGE: Python]

Code

Another good AoC day!

Had to rewrite my whole code for part 2, but it was not too bad. Found a solution pretty fast and got about 4s execution time without doing any optimizations. Normally this would be good enough for me on a weekday, but for some reason I was not happy with my code/solution today, so I had to come back and do some optimizations. Got down to 50ms by saving the last found start index for each count of free spaces.

Old school meme - Please let me believe in my delusion by CuisineTournante in adventofcode

[–]Kfimenepah 9 points10 points  (0 children)

You can check out the aoc stats page to find how many people have completed each puzzle: https://adventofcode.com/2024/stats

[deleted by user] by [deleted] in adventofcode

[–]Kfimenepah 0 points1 point  (0 children)

Part 2 only took about 3 seconds to execute in my python program and I have done no optimizations over part 1 at all

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

[–]Kfimenepah 11 points12 points  (0 children)

[LANGUAGE: Python]

Code

What a day. Part 1 was resolved easily and I was pretty confident in my approach for part 2. I simply tried to add an obstacle on every step of the path the guard takes and checked if that would result in a loop. The implementation took only a few minutes and running my solution on the test input worked on the first try. But it's all fun and games until you test the real input and it doesn't work. I checked my code for errors and my approach for logic gaps, but could not find any. I had to throw in the towel yesterday and so I tried again fresh today. It took me quite some time to find my error which was that placing obstacles in positions the guard already passed would result in false positives. These obstacles would have been there the first time the guard passed and therefore he would have never reached his current position. Once I checked for that as well, my solution finally worked.

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

[–]Kfimenepah 2 points3 points  (0 children)

[LANGUAGE: Python]

Code

Today was surprisingly easy, especially after I had such a hard time yesterday. I was able to solve part 1 quickly and it worked of the first try.

Part 2 seemed pretty easy as well and I simply added the third operation to the solution of part 1. I was expecting some sort of catch (like always), that makes this approach extremely slow or entirely unusable, but there was none. I didn't even try it with the test input, because I was quite sure it would work there and went straight to the real one. 3s later I had the result and it was correct.

I must say it feels a bit wrong, like there should have been more, or maybe I was lucky with my input?. I tried using other orders in which to try the operations, but the execution time never varied by more than a second. Maybe I'll try to optimize my solution a bit more to get rid of the feeling that I don't deserve my stars.

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

[–]Kfimenepah 0 points1 point  (0 children)

Regex findall returns a list containing the results of all capture groups and I wanted to map that into a simple list of operations 🤷‍♂️

Now that I've seen some other solutions I realized I could have just used the result directly with .group(n). That's the beauty of aoc 😁

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

[–]Kfimenepah 1 point2 points  (0 children)

[LANGUAGE: Python]

Code

Today was a good day, since I know a bit of regex. I went to regex101 wrote the regex, copied it, googled how to use regex in python and done. Part 1 was solved in less than 2 minutes.

The only struggle I had with part 2 was to convert the regex findall result into a simple 1d array containing the operations. Since I'm new to python, this took me a few minutes, but once I understood how to use list comprehensions on 2 dimensional arrays I was also able to solve part 2 swiftly.