Adding solution for Problem022.