Solution to challenge 10 for LearnYouNode.