leetcode1024】的更多相关文章

You are given a series of video clips from a sporting event that lasted T seconds.  These video clips can be overlapping with each other and have varied lengths. Each video clip clips[i] is an interval: it starts at time clips[i][0] and ends at time …
class Solution(object): def videoStitching(self, clips: 'List[List[int]]', T: int) -> int: li = sorted(clips, key = lambda x: (x[0],x[1])) #print(li) lens = len(li) if li[0][0]!=0: return -1 if li[lens-1][1]<T: return -1 count = 0 basetag = 0 i = 0…