Solved minimum path sum problem.