Calculate the maximum sum
for i in range ( N - 1 ) : NEW_LINE INDENT if ( A [ i ] < SuffMaxArr [ i ] ) : NEW_LINE INDENT MaximumSum = max ( MaximumSum , A [ i ] + SuffMaxArr [ i ] ) NEW_LINE DEDENT DEDENT