We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ea9c8c commit bb2a7f2Copy full SHA for bb2a7f2
src/main/java/g1001_1100/s1024_video_stitching/Solution.java
@@ -10,8 +10,9 @@ public int videoStitching(int[][] clips, int time) {
10
int count = 0;
11
int covered = 0;
12
for (int i = 0, start = 0; start < time; count++, start = covered) {
13
- for (; i < clips.length && clips[i][0] <= start; i++) {
+ while (i < clips.length && clips[i][0] <= start) {
14
covered = Math.max(covered, clips[i][1]);
15
+ i++;
16
}
17
if (start == covered) {
18
return -1;
0 commit comments