-
Advent-of-Code
A repository holding all of my solutions to Advent of Code problems (by Noble-Mushtak)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I also used coordinate compression, but had a slightly different take: Keep a 3D boolean array representing whether each points in our compressed space of points is turned on or off. And then for each instruction, just go through all the points affected by that instruction and set their state to true if the instruction is "on" or false if the instruction is "off". This approach runs in about 2 seconds in Scala, and honestly, I'm not sure that the complex cube intersection approach runs faster than this coordinate compression approach, although it would be nice to see a cube intersection approach written in Scala so we can compare apples to apples.
I wrote in the language Clojure (my code). Since this is parallelizable, I was able to take advantage of that and get execution time down to 5 mins 30 seconds. I'm sure that can go down further, especially if I figure out the progressive filtering you mention.
Here, my code is very similar to yours, runs in under 2 mins for C++. In fact, it's so similar, you might think I'd copied it, if it wasn't posted 20 hours ago.