Solved MinimumPathSum in java