In general if you think you can write a better version of an existing answer, go for it. The arena floor is open, and Internet Points® are on the line, there to encourage us to all compete in glorious literary battle to be the most helpful.
If your answer is on some simplistic level suggesting the same solution as another answer, you may still be able to do a better job of delivering that solution. You may give the topic a better treatment, give better advice, make your answer more complete, independent, and thorough, or it may be your communication style helps the concept click better for the querent or other readers.
If your answer is “ultimately the same” because it is pretty much exactly the same in all ways then you should just upvote the previous one. Maybe edit it to improve it a bit if you think there's some small improvements you can make. You're saying you think you can write a better version, so this isn't the case for your situation.
However, make sure the post is visibly better. I said “in general” at the start because there's caveats to look out for lest your efforts backfire into downvotes or not gain recognition:
- Many users are loath to upvote a post that looks like it's contributing no more than a single previous answer did. But if various answers are only contributing a third of an answer and you provide a full one that handles the topic as well as any of them (preferably better), awesome.
- If the question has lots of answers (like 10, 15+) new answers will not gain much attention or traction. Questions seem to acquire some kind of “answer fatigue” when they get enough answers.
There's a scientifically demonstrated dating theory (research paper) that if you bring along a second person who looks a lot like you but not as attractive, you'll look more attractive than if you're on your own. Make sure the other answer is the ugly friend making your answer look good, and be careful you don't wind up with your answer being the ugly friend itself.