Problem 9

Horrible runtime