If it already existed what is the importance of explicitly adding it to the question?
To make it abundantly clear that the requirement is there, since clearly some people didn't notice. And thus presumably explain why it is not a duplicate of questions that don't have that requirement.
The OP of the question stated that, given a specific input, they wanted a specific output. That output, by all appearances, removed whitespace. Therefore, removing whitespace is part of the requirement, even if they were not originally spelled out in the text (and even though the OP quite frankly probably didn't realize it).
So they're not creating new requirements; they're emphasizing existing requirements which, in their opinion, makes the question ineligible to be a duplicate.
I feel like I'm not wrong in keeping the question closed and as the answerer is trying to put more than what is needed in the question they are not helping anybody at all.
I think that you are correct that the question should remain closed, but I also don't think the answerer is adding anything that was not already a requirement.
Even if the question is not a duplicate, it is understated in its desires, since it is not clear on what basis you would remove whitespace. That is, if bracketed text is between two non-bracketed text, how much whitespace do you preserve between them?
From the comments:
I don't have any problem with the edit (though I don't see it %100 right) but with the purpose behind it.
Just because someone is doing a thing to cause an action you don't agree with is insufficient justification for saying that a user cannot do that thing. Edits are good or bad on their own merits, not because of the reasoning for making them (in most cases). Edits are bad because they violate the spirit of the question, the intent of the OP, or generally make the post worse (or not improve it).
If you would find the edit to be unproblematic without the context of the duplicate issue, then it doesn't matter if the edit was made in an attempt to highlight that the editor does not think the question is a duplicate. The edit is valid.
trim()
call, I wouldn't make a big issue out of that and still chose the same questions as dupe target and add a comment for the remaining trim part.2
is a typo and as I said earlier in my post, number #3 of duplicates refers totrim()
and as mentioned in comments that should be added to the list of duplicates or just someone should tell OP about it in comments. The main and emphasized problem is removing things that occur within a specific pattern.