Without a full understanding of the concepts in the question, I can't give a really good answer here. But, that said, remember that
The accepted answer is the one that the OP of the question has determined best helped them.
It may be that the question wasn't fully spec'd and was thus missing some nuggets of information, or that the OP used what you'd said to push themselves in the right direction. If you feel that your answer is wrong, by all means edit it or even consider adding another more correct answer, though if you do, edit your original answer to include a note pointing to the new one and explaining why you've left the original alone.
It may also be worth attempting to elicit a response from the questioner in comments as to why they considered your answer correct, so you can refine your answer, and their question, accordingly.