Note: At the time that this meta answer post was written, the latest revision of this main-site post is/was revision 4.
At least after Tsyvarev edited the title, I don't see a glaring issue. It seems like a clear programming question. If that title edit had been made in Staging Ground, I would have then published it.
Could it be further generalized? Yes. Would generalizing it to the extent that an SME knows how to be better or worse of searchability for someone with a question like it? I think potentially worse. At least coming from the angle of someone doing leetcode challenges. And like it or not, leetcode is not even some tiny little-known thing. I can see this specialized angle to a potentially more generalized question being useful long-term.
I can try to guess why people downvoted it. As Gimby alluded to, SMEs in the C++ tag are pretty involved/active in voting. I think it's probably also a combination of SMEs in C++ having high standards, and some disdain (or some other feeling I don't know) here and there for coding challenge sites. Maybe to an SME, it sounds like a dumb question. I'll try not to judge people's value judgements.
Also, I think the shock in the comments at how this came out of Staging Ground is a little overblown. SG is not meant to fix everything. Reviewers in SG are not expected to SMEs. Aside from the title improvement Tsyvarev made, which I might have preferred to have happened in the SG phase, I think SG kind of did its job. See for yourself. It's there for fixing general issues that don't require SMEise to evaluate.