Add solution for assignment 1 exercise 3.