Array folding should never be this complicated, this was all just me experimenting with the idea. This post (along with most of my other posts) is just a way for me to solidify concepts that I recently learned while also having a way to improve my writing. So I might end up straying in my posts sometimes but that's kinda what makes it fun for me.
Great post and it was very interesting to see the depth you added in the code. Too often people just grab a higher order or a library to do the work without giving it a go to check fundamentals or a new approach. We would never innovate without this curiosity and I applaud your hard work on this and an excellent formed post 👍
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.