← Back to challenges

Find the Overlapping Range

JavaScriptHardlanguage_fundamentalsarrays

Instructions

For an array 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.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is it a Valid Floating Numeric Character?