refactored older problems/added brute force solution for problem3