Implemented Brute force problem