Solved Problem 4

Problem 4 was brute forced without any heuristic. A heuristic for the
problem is commented.