Solution for Problem #26.