Adding solution file for problem 2