Hum... I totally disagree with your opinion. Sometimes, to learn, we need a 'solved' problem. This could be the beginning to learn how to do the things right. I know you could say that hard work to try to solve could be better to learn.. but sometimes we need a help. So, if you think this solution isn't usefull... patience! I did what I think it's right! To Show a solution to people who doesn't know how to solve a question!Looks good..... However at this site we tend NOT to provide "answer" when the original poster did not show any work/thought regarding the assignment. We want the student to "discover" the answer. You could have nudged the OP towards the answer - without providing the full work and the answer.
Best wishes!
P.S.: "Judge a man by his questions rather than by his answers".... Am I beeing judged because of my answer? <== This is a question!