added solution to problem 18