added brute force solution to problem9