Nice! the Either was a cool thing to show off. Also showcasing how you optimized was neat. I did recursion for this. Not something I remember ever touching on before, so learning the proper way to do that was pretty fun.
@flwi16 күн бұрын
Nice one! I was worried the recording might crash because you ran oom ;-) I came up with the same solution - really annoying that the problem statement was misleading. Mine is a bit slower, because I clone the hashmap at the beginning of the iteration (which is unnecessary) and I also didn't know about div_rem_euclid. Looking forward to a session where you need to run a profiler to find the bottleneck, since I've never done that in the rust world.
@chrisbiscardi16 күн бұрын
@@flwi haha yeah I definitely double checked the recording when that happened. I record to .mkv though so worst case is that the recording cuts off and I restart it (then have to edit two files). The whole file isn't lost. For AoC I usually use dhat for heap profiling and have run flamegraphs and such before in videos. Was there a particular kind of profiling you were interested in seeing?
@reversev977816 күн бұрын
I created a vector of tuples with each value and how many times it appears. At the start of every blink, I would combine all tuples of the same value by adding the amount of times each appears. Ran very fast but I’m new to rust so I haven’t made any proper benchmarking yet
@reversev977816 күн бұрын
Did basically the same thing as you for part 1 tho
@aderakin539516 күн бұрын
Nice solution! Can i know what terminal are you using and how do i get the terminal to move the side like that
@chrisbiscardi16 күн бұрын
I use alacritty+nushell, but the window behavior is driven by yabai, which is a macos window manager with binary space partitioning layout.
@praveenpp292916 күн бұрын
i used cached crate to optimize
@chrisbiscardi16 күн бұрын
oh that looks very interesting! I hadn't seen it before, thanks for pointing it out.