Problem 12 solved

Back to brute force it is, but with major improvements (instead of taking forever it now terminates more or less immediately).