This question already has an answer here:
I posted a question. After messing around on my machine for about an hour, I found a solution. Would it be more appropriate to remove the question, or to add the answer to it just to save some other poor idiot the trouble I went through?
Re: The duplicate. I was asking in a specific situation whether it is more appropriate to give an answer or delete a question to which I was able to find an answer soon after asking. I see this as being somewhat different from the situation of the other question.