This morning I answered (>10k) a question on Stack Overflow. Someone here commented on my answer, saying that it was a bad practice to answer a dupe.
I really don't like the solution in the dupe he linked, plus it doesn't solve the whole question (getting rid of some spaces too).
What should I do if this case ever happens again?
Should I look for a dupe that doesn't necessarily answer the whole question, or should I answer directly, since I know an answer?