Brute force solution to Problem 14
Solved problem 17