Add solution for problem 46