Impressed by your ability to explain your thought process so thoroughly as you're rushing through the problem. One point you might think is interesting: for part one, we don't really have to worry about shifting all the boxes. We just need to fill the "found" open space at the end with a box. Then we put our robot on top of the box that it's pushing against. That will get us the same result as shifting all of them.
Sadly completely stuck on part 2 after many hours. My solution solves the small test puzzle but not the larger one. I’ll maybe have another look later.
Nice rank! I did the moves recursively where the function returns whether it could move. Part2 got a bit more complicated bc you don't want to move anything if one thing gets stuck. I ended up solving it by first only checking if things can move and if they can call it a second time and also applying the moves. But yeah, it would have been simpler to collect the coordinates to move like you,
Nicely done, I was also doing recursive and in part2 it took me a while to realize I was hadoukening boxes down the line :D Thought about checking first but seemed like too much rewrite at the time so my quick and dirty fix I did was to just clone my map before the moveBox&&moveBoxButt so only on up and down motion of big boxes (boxbutt is scientific term for right side of box when you are reusing part1 box as left side of big box) and if it failed just revert the map. somehow performance didn't really suffer.
@Beesman88 Oh I didn't even consider that. I also could have just copied the map before the step and revert to it if the move failed. I was already returning whether the move was successful or not. It's always a good idea to think about the solution again after some time. It also doesn't help that puzzles drop at 6am here :D
@@Bundas102 I share your exact pain as a night owl in CET time zone, last year I woke up for every task, this year i slept through 3 already and most of them I am reading the question while brewing coffee :D
@@Beesman88 So far I haven't missed one this year, but I had a few days when I went to sleep at 3am, got up for AoC, got the stars and went back to sleep :D
27:08 - afaik sets are not ordered. But, I was using sets for each step (I can't think of a scenario when one coordinate is added at one step, then tried to be added after some steps. So, you have the robot, then you have a set of boxes which need to move, which are adjacent to the robot, then set of boxes which need to move and are adjacent to first set of boxes, then set of boxes adjacent to second set and so on. And then added these sets to the list, so I could have order. It doesn't matter in which order you "process" boxes inside a "set", if they are "same distance" from the robot, but it makes sense to process sets one after another.
For part 1 you technically don't even need to move. If you count the boxes until you find a free spot, you just set n tiles in front of the new position to a box. You don't have to care what they were before. Though the generic way has the benefit of being reusable for sideways movement in part 2.
Lol i was shocked when i solved pt1 in 16 minutes at it was 600th place, then I briefed over part 2 and i'm like crap this sucks, I wonder if anyone solved it, checked the leaderboard and ur 1 or 5 people on it!! Big W for the humans today
Well, I did both parts, first one easier, second a bit troublesome, but once I got it working on sample inputs - it spit out correct answer for my input, which is nice, so there were no magic edge cases, or my code handled it all very well. But with input manipulation I got surprised again. At first(for part1) I was thinking that boxes which have obstacles from 2 consecutive sides can't move further, and it itself becomes an "obstacle". So if for part 2 there would have been something like repeat instructions 100000000000 times - I was going to do some optimizations.
Impressed by your ability to explain your thought process so thoroughly as you're rushing through the problem.
One point you might think is interesting: for part one, we don't really have to worry about shifting all the boxes. We just need to fill the "found" open space at the end with a box. Then we put our robot on top of the box that it's pushing against. That will get us the same result as shifting all of them.
Great respect for you sir! Even explaining your thoughts while you’re at it at this speed is incredible.
Congratulations! 🎉
Congratulation !!!
Pretty funny to see you arrive late today and finish a the 2nd place for the part 2 ahaha
only 3 seconds away from 1st 😭
Congrats with the 2nd place. Great explanation to the problem - especially part 2!
Sadly completely stuck on part 2 after many hours. My solution solves the small test puzzle but not the larger one. I’ll maybe have another look later.
congrats man. love your vids
Nice rank!
I did the moves recursively where the function returns whether it could move. Part2 got a bit more complicated bc you don't want to move anything if one thing gets stuck. I ended up solving it by first only checking if things can move and if they can call it a second time and also applying the moves. But yeah, it would have been simpler to collect the coordinates to move like you,
Nicely done, I was also doing recursive and in part2 it took me a while to realize I was hadoukening boxes down the line :D
Thought about checking first but seemed like too much rewrite at the time so my quick and dirty fix I did was to just clone my map before the moveBox&&moveBoxButt so only on up and down motion of big boxes (boxbutt is scientific term for right side of box when you are reusing part1 box as left side of big box) and if it failed just revert the map. somehow performance didn't really suffer.
Same here. First dfs to check valid then dfs moving as it comes back with recursion
@Beesman88 Oh I didn't even consider that. I also could have just copied the map before the step and revert to it if the move failed. I was already returning whether the move was successful or not. It's always a good idea to think about the solution again after some time. It also doesn't help that puzzles drop at 6am here :D
@@Bundas102 I share your exact pain as a night owl in CET time zone, last year I woke up for every task, this year i slept through 3 already and most of them I am reading the question while brewing coffee :D
@@Beesman88 So far I haven't missed one this year, but I had a few days when I went to sleep at 3am, got up for AoC, got the stars and went back to sleep :D
27:08 - afaik sets are not ordered.
But, I was using sets for each step (I can't think of a scenario when one coordinate is added at one step, then tried to be added after some steps. So, you have the robot, then you have a set of boxes which need to move, which are adjacent to the robot, then set of boxes which need to move and are adjacent to first set of boxes, then set of boxes adjacent to second set and so on. And then added these sets to the list, so I could have order. It doesn't matter in which order you "process" boxes inside a "set", if they are "same distance" from the robot, but it makes sense to process sets one after another.
Well done
For part 1 you technically don't even need to move. If you count the boxes until you find a free spot, you just set n tiles in front of the new position to a box. You don't have to care what they were before. Though the generic way has the benefit of being reusable for sideways movement in part 2.
I was so happy to see you in second last night.
Lets go, you're starting to heat up now LLM cheaters are starting to fall off 🙌
Lol i was shocked when i solved pt1 in 16 minutes at it was 600th place, then I briefed over part 2 and i'm like crap this sucks, I wonder if anyone solved it, checked the leaderboard and ur 1 or 5 people on it!! Big W for the humans today
Well, I did both parts, first one easier, second a bit troublesome, but once I got it working on sample inputs - it spit out correct answer for my input, which is nice, so there were no magic edge cases, or my code handled it all very well.
But with input manipulation I got surprised again. At first(for part1) I was thinking that boxes which have obstacles from 2 consecutive sides can't move further, and it itself becomes an "obstacle". So if for part 2 there would have been something like repeat instructions 100000000000 times - I was going to do some optimizations.
Surprisingly this day was also my best yet. Albiet 3236 but its my first year doing AOC and im using rust lol
Impressive, do you have some techniques to automatize some of the thinking and not struggle on details ?
sick
Now I'm curious to see your keyboard
4:08 you could have just put a box in the empty space and put the robot in the box it's next to. Tricky but not too tricky
Why don't you use an editor with an LSP? Or even an editor with stupid autocomplete? Wouldn't that be faster?
Close one! lol