solve Minimum Path Sum