Solution for problem 14
Solution for problem 15