Solution 11 - brute force
Solution 12