Add solution to problem 243