I solved part 1 the naive way and was reasonably happy with it. I was successfully using that solution with some negative-modulus junk to brute force part 2 (I could get the correct answer for the example data's smaller number of steps), but there was no way it was completing in a reasonable amount of time or without blowing all my RAM. I was at a complete loss for how to solve part 2 the "smart" way, so I learned from this video: https://www.youtube.com/watch?v=9UOMZSL0JTg

I understand why this works now, but I was not going to be getting it on my own (nor did I really want to spend the time it would have taken me to attempt to arrive at a similar solution).
This commit is contained in:
2023-12-21 09:50:37 -06:00
parent 11fc463922
commit bf16614487
4 changed files with 277 additions and 0 deletions

View File

@ -73,6 +73,8 @@
<EmbeddedResource Include="inputs\20.txt" />
<EmbeddedResource Include="inputs\20a.txt" />
<EmbeddedResource Include="inputs\20b.txt" />
<EmbeddedResource Include="inputs\21.txt" />
<EmbeddedResource Include="inputs\21a.txt" />
</ItemGroup>
<ItemGroup>