I decided to re-explore a challenging problem first encountered in graduate school as an excuse to experiment with modern web technologies, specifically WebAssembly and Serverless.
Because a large part of the challenge is memory, I started by implementing a version of this stackoverflow answer in AssemblyScript. I wasn't impressed by the compiler output so I hand tuned the .wat directly because why not.