Sometimes, I will post an answer which works relatively well but then a comment suggests a slightly better, more concise, etc. approach (e.g. julia select all but one element in array/matrix).
What is the proper etiquette in this situation? Ideally, it would seem that the published answers should reflect the best available solution, which would favor me revising my answer. But, I don't want to plagiarize someone's comment.
My thought is to
Revise my answer to reflect the best available response
add an "edit" note at the bottom naming and appreciating the user for their comments.
Is this the proper approach in such a situation?
Update: And, if the approach I suggest is correct, are there any guidelines for how significant of changes it is appropriate to make? As in, is there perhaps a threshold where I should just delete my answer and/or urge the commentor to post their comment as an answer? Or, if they felt comfortable leaving their input as a comment, is that essentially giving me liberty to incorporate it as much as I see appropriate in the answer? (presumably because they didn't think it was worth it to them and/or the community to write out a whole new answer on their own).