Calculate the minimum sum
for i in range ( N - 1 ) : NEW_LINE INDENT if ( A [ i ] < SuffMinArr [ i ] ) : NEW_LINE INDENT MinimumSum = min ( MinimumSum , A [ i ] + SuffMinArr [ i ] ) NEW_LINE DEDENT DEDENT