day 06 - advent of code 2024 in rust

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

I tested your code a bit and could get quite a speedup to the part 2 by adding rayon. You can add `use rayon::prelude::*;` and then replace `.iter()` on line 63 with `.par_iter()` and the bench time drops from 1.5s to 136ms (Ryzen 9 5900X)

Dilaz
Автор

I got stuck on part 2 this time. It works for the test input but not the real input. I kind of followed the same strategy, but instead of collecting all visited positions to loop after, I already check if it's a loop if a wall is added in front of the guard each step.
I'm sure there's something wrong in my logic, I'll try again tonight

douglasgabriel