Adding solution for Exercise 13.