Problem3 using mutch brute force, i need to improve this