add a brute force solution for problem 31
add a brute force solution for problem 31