problem 5 - slow brute-force