I think I solved problem3 via brute force?