Added a list comprehension-style solution to problem 3