Add solution and unit tests for problem 4