Add brute force solution for problem 5