Given an input list of integer ranges, find and output the ranges that overlap with at least 1 other range.
The order of ranges in the output is not important.
If a range appears more than once in the list, then it is considered an overlap with other instances of the
same range, hence the range must appear in the output as many times as it does in the input.
Feel free to define your own data structures.
Examples
Input 1:
[
(1, 10),
(15, 20),
(101, 110),
]
Output 1:
[
]
Input 2:
[
(1, 10),
(15, 20),
(101, 110),
(18, 22),
]
Output 2:
[
(15, 20),
(18, 22),
]
Input 3:
[
(1, 10),
(15, 20),
(101, 110),
(1, 10),
(1, 10),
(105, 120),
]
Output 3:
[
(1, 10),
(1, 10),
(1, 10),
(101, 110),
(105, 120),
]
Input 4:
[
(1, 10),
(15, 20),
(101, 110),
(18, 30),
(27, 35),
]
Output 4:
[
(15, 20),
(18, 30),
(27, 35),
]
Input 5:
[
(5, 10),
(301, 400),
(180, 200),
(100, 300),
(120, 150),
(160, 170),
(195, 220),
]
Output 5:
[
(180, 200),
(100, 300),
(120, 150),
(160, 170),
(195, 220),
]
*/