Brute force implementation
Solution for Problem #6