Cody

Problem 2560. expand intervals vol.2

Similar to problem 2528. This is a more general case, when bounds creates intersections between intervals. Description changes just a little bit from the original:

Given a row vector of an even number of integers. Each pair of consecutive integers is the lower and upper bound (included) of an integer interval. Return a row vector which consists of all the integers, ordered, non repeated, within these intervals.

See also problems 2561 and 1986.

Solution Stats

73.13% Correct | 26.87% Incorrect
Last solution submitted on Feb 24, 2019