Adding solution for problem 25