Traverse the array
i = N - 2 NEW_LINE while ( i >= 0 ) : NEW_LINE INDENT maxSuffix [ i ] = max ( maxSuffix [ i + 1 ] , arr [ i ] ) NEW_LINE minSuffix [ i ] = min ( minSuffix [ i + 1 ] , arr [ i ] ) NEW_LINE i -= 1 NEW_LINE DEDENT