Contest 131 - Prob 4 Video Stitc

2019-04-07  本文已影响0人  人树杨
class Solution:
    def videoStitching(self, clips: List[List[int]], T: int) -> int:
        res, current = 0, 0
        while True:
            current = max([j for i, j in clips if i <= current and j > current], default=0)
            if current == 0: return -1
            if current >= T: return res + 1
            res += 1
上一篇下一篇

猜你喜欢

热点阅读