Create a component that takes a hardcoded array of intervals and merges any overlapping intervals.
HardProblem Statement
Create a component that takes a hardcoded array of intervals and merges any overlapping intervals.
Sample Input
[[1, 3], [2, 6], [8, 10], [15, 18]]
Sample Output
Merged Intervals: [[1, 6], [8, 10], [15, 18]]
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React from "react"; const MergeIntervals = () => { return ( <div> {/* Display merged intervals */} </div> ); }; export default MergeIntervals;