Added a brand new solution for the third problem.