Add solution to problem 39
Add solution to problem 42