Add solution and test for problem1