I'm asking why this question was closed.
Picture of the post in case it gets re-deleted:
The close reason is:
This question appears to be off-topic. The users who voted to close gave this specific reason:
"Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it."
But I don't see any request for any off-site resource. The OP simply wants to know how to get the indexes for duplicate elements.
Maybe the question was closed for other reasons? The question doesn't include an attempt at the problem, and isn't particularly well-written or insightful, which could contribute to it being viewed as low-quality. However, this doesn't seem to fit as 4 of the 5 reviewers chose the 'off-site' reason.
Any ideas? Should it be reopened?
Edit:
It has been reopened and reclosed as "too broad". I'm not sure I agree with that either, as there are plenty of questions that ask, "How do I do {simple task}?" that aren't closed as such.
Furthermore, I think I have a better solution. After looking around a bit more extensively, I found this duplicate. We should close this question as a duplicate. Of course the original can then be closed as "too broad" if wanted.
For those wondering why my answer seems to mirror the top, older answer, it is because that answer originally used a different (wrong) method. When I pointed out the flaw, his answer became pretty much the same as mine. (And attracted some upvotes for being older I suppose.)