':type timeSeries: List[int]
:type duration: int
:rtype: int'

def findPoisonedDuration(self, timeSeries, duration):

    result = (duration * len(timeSeries))
    for i in xrange(1, len(timeSeries)):
        result -= max(0, (duration - (timeSeries[i] - timeSeries[(i - 1)])))
    return result
