After I answered this question, it was closed as opinion-based. I don't see that, although I can imagine a too-broad reason. It asked "I'm having difficulty visualizing how the code will run. Is there an intuitive way to approach the understanding of this piece of code?" I suppose that could be seen as opinion-based, but it clearly is an attempt to ask how and why the code in question works. I hope that the answer I gave can help a bit.
I'm tempted just to reopen. I don't like having the power to reopen on my own without others' input, but I do feel this was closed in error. However there were three experienced people listed as having closed the question, so I'm afraid I'm missing something. The history shows it was closed earlier as an (incorrect) duplicate then reopened by the same person, so there's a lot going on.
There is one portion here which is full of opinions. The comments on this question (including one of my own) express opinions about the style of code under discussion. But that's not a good reason to close a question, is it?
My answer was an attempt to explain how the code works; it did start with an opinion about the example used to illustrate the function, and it ended with a strong opinion about relative elegance of different styles. But in between was a straightforward attempt to explain how the code works. Moreover, we don't close questions because of opinions in answers, do we?
Should I just go ahead on reopen this one? Should I defer to the wisdom of the three who closed it? Is there any other alternative?