Checks and calculates the length if last element of the array is the last element of a mountain sub - array
if ( k != - 1 and j != - 1 ) : NEW_LINE INDENT if ( d < k - j + 1 ) : NEW_LINE INDENT d = k - j + 1 NEW_LINE DEDENT DEDENT return d NEW_LINE