Post

I've completed "Plutonian Pebbles" - Day 11 - Advent of Code 2024 #AdventOfCode real 0m0.018s user 0m0.014s sys 0m0.003s No memoization, single threaded! Well, AFTER I first tried those things with the wrong algorithm :D Glad I figured it out! github.com/int2str/adve...

0 reposts3 likes

Nice, if I'm understanding correctly this is similar to my solution. What kind of data structure is the buffer though? Oh and what is [[nodiscard]]'s role here?

Yupp, exactly the same solution as yours basically. Buffer is a a hash map: using StoneCount = std::unordered_map<uint64_t, size_t>; [[nodiscard]] produces a compiler warning (or error in my case) if you call this function and ignore the return value. It has no runtime effects.