Problem 10 done, albeit more of a brute force approach and not elegant