Solution for problem #9 (just a list comprehension)