You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just want to say a huge thanks for this repo. Would say am relatively experienced dev (js/ts). Decent at frontend/backend/reacty/nexty/nodey stuff but am a complete noob when it comes to any heavy lifting with algorithms. This is my first time doing AoC, really enjoying it. I can solve most of them with basic loops/brute force, though already have run into issues on day 5 pt 2 using this approach (thought 'oh this is easy, just generate a massive list of seeds using the ranges and then run the same loop'. Wouldn't even generate the seeds before the laptop threatened to explode :)).
Is so helpful to see how someone else approaches the problem from a more algorithmic angle - especially when the code is so well documented and clean.
Will be following along. Thanks again!
The text was updated successfully, but these errors were encountered:
And Day 5, part 2 was a bear! I don’t have a strong CS background, so often I’m the one brute forcing or feverishly googling algorithms. I somehow managed to come up with something on this one though.
This is my "cleaned up" solution. The initial solve was such a mess that
it didn't seem worth committing. This was an interesting problem. There
was no single "Aha!" moment, instead I started with a brute force
solution(which is still in Part 1), and then progressively refined it.
The three key refinements (in the order I applied them) were:
1. Only build valid permutations, aborting as soon as a possible
permutation is invalid
2. Memoize
3. Don't actually build the valid permutations, just count them
At first, I saw no way to write #1... and honestly I still don't. But I
was able to get there step by step by working from simple test cases
and doing a lot of debugging. #2 was simple enough. Then, I finally
got #3 after staring at Node's memory usage for an hour or so, and
thinking over and over, "Man, this seems memory bound, not CPU bound."
Turns out, arrays of trillions of strings are pretty big.
Just want to say a huge thanks for this repo. Would say am relatively experienced dev (js/ts). Decent at frontend/backend/reacty/nexty/nodey stuff but am a complete noob when it comes to any heavy lifting with algorithms. This is my first time doing AoC, really enjoying it. I can solve most of them with basic loops/brute force, though already have run into issues on day 5 pt 2 using this approach (thought 'oh this is easy, just generate a massive list of seeds using the ranges and then run the same loop'. Wouldn't even generate the seeds before the laptop threatened to explode :)).
Is so helpful to see how someone else approaches the problem from a more algorithmic angle - especially when the code is so well documented and clean.
Will be following along. Thanks again!
The text was updated successfully, but these errors were encountered: