Add problem 1002 solution.