An attempt to solve an interview question mentioned by The Primeagen on his streams.
Please attribute any errors to my flawed understanding of his description (the best one I witnessed can be found here) rather than to my lack of programming ability.