Python O(n) time and O(1) space solution
\nclass Solution:\n    def findPoisonedDuration(self, timeSeries: List[int], duration: int) -> int:\n        if len(timeSeries) == 0:\n            return 0\n   
```\nclass Solution:\n    def findPoisonedDuration(self, timeSeries: List[int], duration: int) -> int:\n        if len(timeSeries) == 0:\n            return 0\n        \n        ans = 0\n        \n        for i in range(0,len(timeSeries)-1):\n            ans += min(timeSeries[i+1] - timeSeries[i], duration)\n            \n        return ans + duration\n```
['Python']