problem 43 solved with brute force