I've come across this situation a few times, and I'm not sure what to make of it. A user will post a question, often there is a bug in his code that he cannot find. Someone, perhaps multiple people, post answers addressing the problem. Then, the user takes that information, fixes his code, and posts the revised now-working version as an answer. This often happens with newer users.
Here are recent (past 24 hours) examples:
When is this approach, using answer to fix and posting working code, appropriate? Always? Never? Only if ...? Should these answers be flagged for moderator attention? Should one leave a comment to the OP, and, if so, to what effect?