Video quality today is a bit lower than I'd admittedly like, and I apologize for that. I don't have time to script these and I'm a bit tired after all of my exams and this was recorded at 2 AM (which is also why I'm quieter than usual); I may start uploading my videos around noon instead in the future since these problems are starting to take a long time to solve and especially create a solution that I can show on the channel.
No worries! I really appreciate the effort you put into these videos in order for others to learn! I hope your exams went well 🤞 Did you finish first? ;-)
@@flwi Haha, no, I didn't finish my exam early. Hoping I didn't mess up too much stuff, I was probably underprepared for it though :) Thanks for the kind comment though!
@@fredoverflow Thank you for your feedback! That is true, I think there is value in seeing both that people at the top of the leaderboard do still make mistakes, and also more importantly how to find these mistakes.
Very interesting and useful! Never thought about using complex numbers like this. Would love to see a video on its principles and applications in coding, like the great one you did on mod arithmetic!
For part 2, finally I checked for a repetition of full lines. The first horizontal rock is pretty good in giving them. Funny thing, the example jets will never produce any.
In my case, I have almost the same solution. But in the first part, I used the itertools.cycle function (that essentially cycles through an iterator). So after defining jets=cycle(...) my loop is simply for rc in range(2022): jet = next(jets) I'm not sure if there is some disadvantage to doing it this way, but I think is much clearer (no nested loops and no need to check if rc>=2022) For the second part, I ran it for 10_000 rocks storing the difference and after that, I looked for the cycle. It's not the best solution but runs essentially instantly.
Probably no disadvantage. I only learned about that yesterday, it seems very convenient and I can't imagine it having any performance issues. Yeah, the cycle is a bit shorter than what my solution will detect (and also my solution is just not very optimized). If I do revisit this year's AoC problems with a focus on optimization (which has been requested), I will keep other options in mind!
Video quality today is a bit lower than I'd admittedly like, and I apologize for that. I don't have time to script these and I'm a bit tired after all of my exams and this was recorded at 2 AM (which is also why I'm quieter than usual); I may start uploading my videos around noon instead in the future since these problems are starting to take a long time to solve and especially create a solution that I can show on the channel.
No worries! I really appreciate the effort you put into these videos in order for others to learn! I hope your exams went well 🤞 Did you finish first? ;-)
I actually love the little live debuggings; way more interesting than 30 minutes of unrealistic perfection!
@@flwi Haha, no, I didn't finish my exam early. Hoping I didn't mess up too much stuff, I was probably underprepared for it though :) Thanks for the kind comment though!
@@fredoverflow Thank you for your feedback! That is true, I think there is value in seeing both that people at the top of the leaderboard do still make mistakes, and also more importantly how to find these mistakes.
Very interesting and useful! Never thought about using complex numbers like this. Would love to see a video on its principles and applications in coding, like the great one you did on mod arithmetic!
Thank you, the explanation is amazing!
For part 2, finally I checked for a repetition of full lines. The first horizontal rock is pretty good in giving them. Funny thing, the example jets will never produce any.
In my case, I have almost the same solution. But in the first part, I used the itertools.cycle function (that essentially cycles through an iterator). So after defining jets=cycle(...) my loop is simply
for rc in range(2022):
jet = next(jets)
I'm not sure if there is some disadvantage to doing it this way, but I think is much clearer (no nested loops and no need to check if rc>=2022)
For the second part, I ran it for 10_000 rocks storing the difference and after that, I looked for the cycle. It's not the best solution but runs essentially instantly.
Probably no disadvantage. I only learned about that yesterday, it seems very convenient and I can't imagine it having any performance issues.
Yeah, the cycle is a bit shorter than what my solution will detect (and also my solution is just not very optimized). If I do revisit this year's AoC problems with a focus on optimization (which has been requested), I will keep other options in mind!
I still couldn't understand the complex numbers and why it even works!
Complex numbers are used here as 2D vectors. They have the advantage of being added and compared easily. I was confused at first too... :)