added an inefficient brute force solution for problem 10