Beats 100% Runtime O(n) Time O(1) Space Python/C
ApproachIf iteration [i] of our loop we have the value timeSeries[i] and it conflicts* with timeSeries[i+1], we need to know how many poison seconds happened be
# Approach
<!-- Describe your approach to solving the problem. -->

If iteration **[i]** of our loop we have the value **timeSeries[i]** and it conflicts* with **timeSeries[i+1]**, we need to know how many poison seconds happened before the confliction. We are not including a poison second on **timeSeries[i+1]** or any poison seconds past it, because we will move on to **iteration [i+1]** and count poison seconds from then. 

*I refer to a confliction as when the value at timeSeries[i] + duration is greater than or equal to the value of timeSeries[i+1]

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    O(n) 

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
    O(1)

# Code
```python3 []
# Code - Python3 - Beats 90% Runtime
class Solution:
    def findPoisonedDuration(self, timeSeries: List[int], duration: int) -> int:
        ttl = 0 # Initialize the total poison damage seconds

        # Iterate through len(timeSeries)-1
        # Not iterating through the last one, because it will
        # have no conflictions
        for i in range(len(timeSeries)-1): 

            # If there is no confliction, just add the duration
            if timeSeries[i] + duration - 1 < timeSeries[i+1]:
                ttl += duration
            # If there is a confliction, only add the poison
            # damage seconds that happened before timeSeries[i+1]
            else:
                ttl += timeSeries[i+1] - timeSeries[i]

        # Return the total, plus the damage duration from
        # the last time interval
        return ttl + duration
```
```c []
// Code - C - Beats 100% Runtime
int findPoisonedDuration(int* timeSeries, int timeSeriesSize, int duration) {
    int ttl = 0;
    for (int i=0; i < timeSeriesSize-1; i++) {
        if (timeSeries[i] + duration - 1 < timeSeries[i+1]) {
            ttl=ttl+duration;
        }
        else {
            ttl = ttl + (timeSeries[i+1] - timeSeries[i]);
        }
    }

    return ttl + duration;
```
['C', 'Python3']