Yeah, that was me, and this is a good question. Bob linked to what is probably the canonical discussion in a comment. Notice that there are links to other similar questions in a comment there.
This is one of those areas where opinion is split. The original intention of the site founders was that it is preferable for each answerer to post a single, comprehensive answer containing all of their solutions, along with an explanation of when each solution is the best one. However, the community seems to lean in the direction that it is permissible, sometimes even preferable, to post separate answers in cases where the answers are radically different and self-contained. Another consideration would be if each answer is long, and combining them into one extremely long post would discourage readership.
I normally combine multiple answers. Occasionally, I post radically different solutions as separate answers. I think in some cases, it is actually easier for the reader to follow different self-contained answers that stand on their own.
That also better supports the site concept that the best solutions rise to the top through voting, which is intended to provide guidance to readers who don't know the answer. Consider a case where someone posts an answer containing a great solution and additional not-so-great solutions, or many clever but niche solutions. The post can collect upvotes based on the great solution, or different people finding different component solutions helpful. But that doesn't help a reader know which solution is what voters think is great.
On your question, I posted multiple answers for a different reason -- they're actually answers to different questions. Ideally, the question should be made crystal clear and then only direct answers to that question should be posted. In this case, there are actually two different problems that readers may associate with the question.
I misinterpreted the question stumbling over grammar errors, which I cleaned up. So now it might be less likely for other readers to land there by mistake with a different problem than yours. I left the first answer because the two problems are easy to describe in similar ways, and it seems likely that other readers may land there by mistake.
I'm open to comments here about whether the first answer should simply be deleted, or whether it might be helpful to leave it just in case.