Skip to content

Commit bb2a7f2

Browse files
authored
Improved task 1024.
1 parent 3ea9c8c commit bb2a7f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/g1001_1100/s1024_video_stitching/Solution.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ public int videoStitching(int[][] clips, int time) {
1010
int count = 0;
1111
int covered = 0;
1212
for (int i = 0, start = 0; start < time; count++, start = covered) {
13-
for (; i < clips.length && clips[i][0] <= start; i++) {
13+
while (i < clips.length && clips[i][0] <= start) {
1414
covered = Math.max(covered, clips[i][1]);
15+
i++;
1516
}
1617
if (start == covered) {
1718
return -1;

0 commit comments

Comments
 (0)