Every now and then, we get an answer flag the declares an answer a duplicate of another. So far, I haven't really acted on them – except for leaving a comment if the flagger hadn't done so already – since we don't have an official policy regarding duplicate answers.

This discussion has two parts:

1. What exactly should count as a duplicate answer?

So far, we had the discussion Identifying Duplicate Answers which currently suggests using a comment to vote on. That's not really practical; you can't downvote comments.

There's also Are these answers duplicate?, which discusses whether calling a solution in another language with a system call (or similar) is considered a duplicate. The votes seem to lean towards allowing this, but there is no strong consensus.

2. What should happen to duplicate answers?

Duplicate questions are closed, but you can't close an answer. Locking would be the closest equivalent, but that's not really what locks are for.

I can't think of an option besides deleting and leaving them alone. If we opt for the latter, discussing item 1 is pointless.

I think we shouldn't take action against duplicate submissions, even when the code is identical. We should assume good faith: the second submitter almost surely came up with the code on their own. We see on anarchy golf that identical submissions are common among experienced golfers when code is hidden.

We have enough of a FGITW problem where people rush out fast answers to get votes and attention. Allowing only one of a solution makes it more of a race. Moreover, deleting the slower-posted of two identical solutions is frustrating to the poster, who showed just as much skill. This is more likely to be a newer user, who isn't constantly refreshing the question page and needs more time to write and format a submission.

I understand that a dishonest poster could copy another solution and claim they found it independently. I wouldn't expect this to be a problem from what I've seen -- people seem to be gracious in crediting others and selfless in suggesting improvements. I'd reconsider if it became a visible problem.

• I would suggest that if there is a duplicate(winning) answer, the poster of the challenge would accept the first answer, but upvote the slower answer to show that their answer was just as good. The duplicate might even have a better explanation. I think it is important to assume that all answer are legitimate. Without that, we could never know if an answer is copied or not. Dec 7 '16 at 15:50
• @xnor what if the code is exactly the same? is it plagiarism at that point? Dec 7 '16 at 17:06
• @tuskiomi No, I'd assume it's independent discovery even when the code is exactly the same.
– xnor
Dec 7 '16 at 20:55
• What the point of having two identical answers? It just clutters the answer list.
– user45941
Dec 8 '16 at 2:03
• @Mego This is a place where I see us as deviating from Q&A standards by being a challenge site. Our "answers" aren't actually answers that are useful to people, but submissions where people show what they accomplished.
– xnor
Dec 8 '16 at 19:46
• @tuskiomi I would personally refrain from posting identical code, and have done so when I have come up with identical code. If the code is exactly the same and it's obvious who was first, you are free to downvote. But I would only do that once the second poster has been made aware that their code is duplicate via a comment. Dec 18 '16 at 4:08
• It is difficult obtain the same source code of some other without copy... Possible I wrong in the case programmers are not much different (too much strong or follow the same school)
– user58988
Mar 27 '19 at 13:33
• I definitely agree with this answer, but I think that if the markdown of the two answers are identical, it's a lot more likely to be a copy+paste, and that should be treated differently. Especially if the answer text is longer. Oct 2 '19 at 16:19

Well, that's a hard one to answer. There are some obvious cases, but a lot of the time it comes down to a judgement call. You have to ask yourself, "Does this add anything to the site, given that there is already answer X?" If the answer is no, it's probably a duplicate.

Some obvious cases:

• Exact same code in the exact same language
• Exact same code in basically the same language (using a trivial derivative or a similar language that only requires minor syntax changes)
• Using the code from another answer (like int main(){system("cat");return 0;} in C versus cat in bash)