I just came across this question. As soon as OP found the solution, they edited their question and added the answer instead of posting properly posting a new answer. Another user removed the answer from the question and posted it himself. He gave credit to OP, but he didn't change anything else about the answer.
Is there something wrong with doing so? I am conflicted. On the one hand I feel like it would have been better to leave OP a comment and giving them the chance to post it themselves, but on the other hand the answer really doesn't belong in the question body and low-rep users are usually never to be seen again after they have found a solution.
In this post the community came to the conclusion that posting someones comment as an answer is acceptable and this situation seems quite similar.
A few clarifications by the user who posted the answer:
- I posted the answer only after a comment was made asking the OP to do so, which he did not.
- I commented multiple times that I will delete the answer at the OPs request. Why? because I have no idea if he'll ever look again at his post. So I'm trying to do this for the community.
- I have done the exact same thing in the past and have even received positive recognition for doing so from the older, high rep SO users.