LetCode Day26 | Temo 공격| 솔루션 격파 100%

351 단어
티모 공격
솔루션(100%-
class Solution:
    def findPoisonedDuration(self, timeSeries: List[int], duration: int) -> int:
        ans = 0
        last = 0
        for val in timeSeries:
                ans += min(val+duration - last, duration)
                last = val+duration
        return ans

좋은 웹페이지 즐겨찾기