If we 're not on the  leftmost, we can consider  the left value.
if ( j > 0 ) : NEW_LINE INDENT tempMax = max ( maxPath [ i ] [ j - 1 ] * arr [ i ] [ j ] , \ minPath [ i ] [ j - 1 ] * arr [ i ] [ j ] ) ; NEW_LINE maxVal = max ( maxVal , tempMax ) ; NEW_LINE tempMin = min ( maxPath [ i ] [ j - 1 ] * arr [ i ] [ j ] , \ minPath [ i ] [ j - 1 ] * arr [ i ] [ j ] ) ; NEW_LINE minVal = min ( minVal , tempMin ) ; NEW_LINE DEDENT