Solution for Minimum Path Sum.