d holds the length of the longest mountain sub - array . If the current length is greater than the calculated length , then value of d is updated .
if ( d < k - j + 1 ) : NEW_LINE INDENT d = k - j + 1 NEW_LINE DEDENT