...

/

Solution: Find Right Interval

Solution: Find Right Interval

Let's solve the Find Right Interval problem using the Heaps pattern.

Statement

You are given an array of intervals where each interval is represented by a pair [starti,endi][start_i, end_i]. The startistart_i values are unique, meaning no two intervals begin at the same time.

The task is to find the right interval for each interval in the list. The right interval for an interval ii is an interval jj such that startj>=endistart_j >= end_i ...

Access this course and 1400+ top-rated courses and projects.