Adding solution for problem 21.
Adding solution for problem 22.