The question was of the "do my homework" type, showing no effort to solve it; but it was clear enough and had a definite solution. A good answer attracted several downvotes, presumably to punish the poster for providing any answer at all to such an "undesirable" sort of question.
My own take is that a downvote to an answer officially means "this answer is not useful". But clearly a correct answer is useful to the OP and to anyone else interested in the question. I don't see that "this answer is not useful" means "this answer is good but tackles a question posed in a way that we don't like on this site". I would think that downvotes to the question, for not showing research effort, would be enough to tell the OP to add such indication the next time.