added solution for hw3 problem 9 and testcase for problem 10