calculating value of maximum Plus ( + ) sign
for i in range ( 1 , n - 1 ) : NEW_LINE INDENT for j in range ( 1 , m - 1 ) : NEW_LINE INDENT ans = max ( ans , up [ i - 1 ] [ j ] + down [ i + 1 ] [ j ] + left [ i ] [ j - 1 ] + right [ i ] [ j + 1 ] + arr [ i ] [ j ] ) NEW_LINE DEDENT DEDENT return ans NEW_LINE