You can, if you want, use an @ reply in the comments to ping the person and ask for them to promote their comment to an answer. Some people would consider this to be the nice thing to do, but opinions vary (see below). You would then wait a couple of days for them to post an answer. If and when that happens, you would upvote and accept their answer.
If they do not post an answer within a reasonable time frame, or you don't want to bother asking them to do so, then you should simply write up an answer of your own, borrowing from and expanding on the information provided in their comment.
Many times (at least for myself), this is what I hoped you would do when I left the comment. I had limited time or desire to write up a complete answer, so I just left you a hint in the right direction, hoping that you would take my hint and run with it, solving the problem for yourself and learning far more than you would have learned from just copying and pasting complete sample code. Armed with all of that newly-gained knowledge, you are in the best position to write an answer. You know that your solution works, because it solved your problem.
When you write such an answer, though, it is definitely expected that you give credit to the original commenter for the hint in the right direction as part of your answer. Something as simple as, "Like RC said in his comment, the widget can be frobbed by…" will suffice. If you like, you can link to the comment itself (clicking the time/date stamp will produce a link).