Add a variaton of the solution for Problem 18