← Back to challenges

Find the Overlapping Range

PythonHardlanguage_fundamentalsarrays

Instructions

For a list of ranges, find the maximum range that is contained in all the ranges. If there is no such range, return "No overlapping".

Examples

overlapping([(1, 7), (2, 8), (0, 4)]) ➞ (2, 4)

overlapping([(5, 10), (2, 15), (10, 12)]) ➞ (10, 10)

overlapping([(11, 18), (3, 7), (2, 20), (5, 16)]) ➞ "No overlapping"

Notes

Both ends are inclusive for all ranges.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.