problem 15

most likely correct, takes too long to solve. Need to optimize