int2str 🇺🇦
int2str.net
int2str 🇺🇦
@int2str.net
After 30+ years of daily driving manual transmission cars, we're now an all-electric family.
End of an era for sure. Bitter sweet....
August 13, 2025 at 3:47 PM
Bubble sort in C++23?!???

I made an "nm_pairs" view during #AdventOfCode, largely as a tool to better understand what it takes to make a custom view in #C++.

github.com/int2str/nm_p...
January 10, 2025 at 7:22 PM
Make your #AdventOfCode problem twice as fast with this one weird trick ...

I was absolutely sure the compiler (clang-18) would do this for me, but alas, it didn't.... Went from ~40ms to ~20ms.

Hat tip to @49pctber.bsky.social
I peeked at their code and was like "nah, THAT can't be it..."
January 8, 2025 at 4:24 PM
Finally figured out how to make my "Utils::views::nm" play nicely with C++23 ranges/views.

This makes the final #AdventOfCode problem super nice in C++!

I need to do a proper write-up on both the AoC problem, as well as the difficulties of making a C++23 custom view....
January 7, 2025 at 4:42 AM
Yes, it can be done, even in less than (one) second[s] :)
December 25, 2024 at 1:42 PM
I've completed "Code Chronicle" - Day 25 - Advent of Code 2024 #AdventOfCode

Man, if I could just turn my mn_const_view() into an actual view, this would actually have been a "one liner" in C++ :)

Thank you, AoC team and participants!
Merry x-mas and happy holidays!!!!!!
December 25, 2024 at 12:05 PM
I keep running in the issue that std::unordered_map<> in C++ is slow. Yes, maps are super convenient (I see you, my Python friends...), but they are not free and can hide their complexity.
Using a flat array and a bitset, Day 22 went from my slowest to be super fast!
#AdventOfCode
December 24, 2024 at 12:34 AM
Given we know the shape of the problem, part 2 can be written cleaner as well...
#AdventOfCode
December 23, 2024 at 10:57 PM
With the benefit of sleep, this can be written much shorter/cleaner/simpler...
#AdventOfCode
December 23, 2024 at 10:54 PM
I've completed "LAN Party" - Day 23 - Advent of Code 2024 #AdventOfCode

Maybe it's the embedded programmer in me, but I always gravitate towards bit-masks for problems like these. No recursion, no graph theory etc., just a bunch of bits...
December 23, 2024 at 9:11 PM
I've completed "Monkey Market" - Day 22 - Advent of Code 2024 #AdventOfCode

Day 22 was an absolute breeze and a blast, after 21 was a thorough kick in the pants for me... Both done now and officially caught up!

Always fun to use fold_left() weirdly :)

Hopefully, no more hard ones 'til x-mas :D
December 23, 2024 at 6:33 AM
Alright, that escalated quickly!
#AdventOfCode

After finishing Day 17 four days ago, I went back and actually implemented a JIT compiler that reads the program from file and emits x86_64 assembly :D

Works for the quine, sample and my input and is blazingly fast!
TOTAL overkill but fun learning!!
December 21, 2024 at 10:45 PM
Fixed the performance issue!
Turns out the algorithm was fine, but the C++ std::unordered_map<> (specifically the hashing) is slow... Switched to a plain array to store distances and voila...
#AdventOfCode
December 20, 2024 at 9:49 PM
I've completed "Race Condition" - Day 20 - Advent of Code 2024 #AdventOfCode

Hmmmm, this is now by far my longest running algorithm for AoC. N*M is never pretty, I guess. I am probably missing an obvious shortcut somewhere (pun intended ;) ) ...
December 20, 2024 at 7:33 PM
Happy to see that we're still at ~1s even on my cheapo $99 2-core laptop. :D
December 20, 2024 at 3:28 AM
I've completed "Linen Layout" - Day 19 - Advent of Code 2024 #AdventOfCode

Inspired by @swcreeperking.bsky.social , I added the ability to print timing info to my little unit test framework.
December 20, 2024 at 3:16 AM
I've completed "Chronospatial Computer" - Day 17 - Advent of Code 2024 #AdventOfCode

Mega fun today writing a cute little "virtual machine" :)
Thought about implementing a JIT :D

And a fun little "Quine detector" for part 2.
Great puzzle today! I needed that after 16..

github.com/int2str/adve...
December 18, 2024 at 6:31 AM
I've completed Part One of "Reindeer Maze" - Day 16 - Advent of Code 2024 #AdventOfCode

This one kicked my butt a bit, not gonna lie. Spent some quality time on Wikipedia... But hey, at least I have a generic implementation of Dijkstra's algorithm in C++ now :)

github.com/int2str/adve...
December 17, 2024 at 9:25 PM
Here's the example visualized:
#AdventOfCode - Day 15
December 16, 2024 at 5:48 AM
I've completed "Warehouse Woes" - Day 15 - Advent of Code 2024 #AdventOfCode

Two more gold stars and one more chance to practice SFML :)

github.com/int2str/adve...
December 16, 2024 at 3:33 AM
This time as actual animation.... *sigh*
#AdventOfCode
December 14, 2024 at 10:17 PM
I've completed "Restroom Redoubt" - Day 14 - Advent of Code 2024 #AdventOfCode

Well, that was fun! Thanks to @mei-eisenbach.bsky.social , we found no less than two algorithms to hone in on the "Anomaly".
Really curious what others have done for this!

github.com/int2str/adve...
December 14, 2024 at 10:05 PM
Went back and optimized "Day 7 - Bridge Repair" by writing my own concatenate operator. It's not that I am smarter than std::format, it's just that I have a much smaller problem space :D

All 13 days so far now execute in ~200ms, running sample AND final input calculations.
#AdventOfCode
December 14, 2024 at 2:11 PM
I've completed "Claw Contraption" - Day 13 - Advent of Code 2024 #AdventOfCode

(No math spoilers)

How dare they make me do math during the holidays - my brain hurts :p

With my ever growing "Coordinate" class and more std::ranges, the code is nice and compact though.

github.com/int2str/adve...
December 13, 2024 at 9:18 PM
I've completed "Garden Groups" - Day 12 - Advent of Code 2024 #AdventOfCode

Day 12 in the bag finally.... A bit late, but did a bunch of infrastructure work to make this less of a pain.

github.com/int2str/adve...

I heard #13 is math problem, so I might be screwed ...
December 13, 2024 at 3:53 PM