Easy Solution
Solution to Find Poisoned Duration\n\n### Intuition\nThe problem involves determining the total duration for which a character remains poisoned given a series o
## Solution to Find Poisoned Duration\n\n### Intuition\nThe problem involves determining the total duration for which a character remains poisoned given a series of attack times and a fixed duration of poison effect. The key observation is that if a new attack happens before the previous poison effect wears off, the poison duration overlaps.\n\n### Approach\n1. **Initialize a counter** to keep track of the total poisoned duration.\n2. **Iterate through the attack times**:\n   - For each attack, check if it is the last attack or if the next attack happens after the current poison effect wears off.\n   - If either condition is true, add the full duration to the counter.\n   - Otherwise, add the time difference between the current and the next attack to the counter.\n3. **Return the total poisoned duration**.\n\n### Complexity\n- **Time complexity**: $$O(n)$$, where $$n$$ is the number of attack times. We iterate through the list once.\n- **Space complexity**: $$O(1)$$, as we only use a few extra variables regardless of the input size.\n\n### Code\n```python\nclass Solution:\n    def findPoisonedDuration(self, timeSeries: List[int], duration: int) -> int:\n        count = 0\n        length = len(timeSeries) - 1\n        for i in range(length + 1):\n            if i == length or timeSeries[i] + duration - 1 < timeSeries[i + 1]:\n                count += duration\n            else:\n                count += timeSeries[i + 1] - timeSeries[i]\n        return count\n```
['Python3']