Python 6 lines O(n) concise solution
The answer is the length of timeSeries multiply the duration with minus the repeat duration.\nRuntime beats 94% and memory usage beats 80% of python solutions.\
The answer is the length of timeSeries multiply the duration with minus the repeat duration.\nRuntime beats 94% and memory usage beats 80% of python solutions.\n\n\n```\nclass Solution(object):\n    def findPoisonedDuration(self, timeSeries, duration):\n        repeat = 0\n        for i in range(len(timeSeries)-1):\n            diff = timeSeries[i+1] - timeSeries[i]\n            if diff < duration:\n                repeat += duration - diff\n        return len(timeSeries)*duration - repeat\n```
['Python', 'Python3']