2025-07-29 16:17:54 +0000 UTC
Teemo Attacking
Categories:
Links
Code
class Solution:
def findPoisonedDuration(self, timeSeries: List[int], duration: int) -> int:
total = 0
cur_end = -1
for second in timeSeries:
if second > cur_end:
total += duration
else:
total += duration - (cur_end - second) - 1
cur_end = second + duration - 1
return total