Add solution for problem #3 (take too long. :/)
Solve #4