3 ms·
Ah, that's a nice observation about zero, that would have saved me some typing. :-) I did the same thing with my actual solution in terms of order (but I went
by dgacmu 3y ago
Ah, that's a nice observation about zero, that would have saved me some typing. :-)
I did the same thing with my actual solution in terms of order (but I went 0, 1, 2, 3), but mostly so I could truncate the matching array to solve part 1. Notably, that was a ret-con of my actual solution to part 1, which I originally did by just mapping the characters through .is_ascii_digit(), but I wanted to consolidate the code a little. I ended up with:
https://github.com/dave-andersen/advent2023/blob/main/src/main.rs https://github.com/dave-andersen/advent2023/blob/main/src/ma...