Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
You are given a series of video clips from a sporting event that lasted `time` seconds. These video clips can be overlapping with each other and have varying lengths. Each video clip is described by an array `clips` where `clips[i] = [starti, endi]` indicates that the i-th clip started at `starti` and ended at `endi`. We can cut these clips into segments freely. Return the minimum number of clips needed so that we can cut the clips into segments that cover the entire sporting event `[0, time]`. If the task is impossible, return `-1`.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.