Add problem 1007 solution.