Sure. If a suggestion you make in comments turns out to be the answer OP was looking for then you should absolutely post that as an answer. Answers shouldn't be in comments; which are meant to be used to ask for clarification, suggest corrections etc. They are not designed to be permanent and can be deleted without warning or notification at any time. Your answer should be as much for future readers as for helping OP.
Comments are short and quick so it's probably a good idea to flesh out the answer a bit and give as much detail as you can; just because it was the answer OP was looking for doesn't negate the fact that you should post a good complete answer that future readers will understand and benefit from.
It may also be a good idea to delete the original comment and flag the other comments as obsolete (assuming they actually are obsolete).