Javascript | 5 - 6 lines | Easy understand | O(n) ✔
\nvar findPoisonedDuration = function(timeSeries, duration) {\n    const length = timeSeries.length;\n    let sum = 0;\n    for(let index = 1; index < length; i
```\nvar findPoisonedDuration = function(timeSeries, duration) {\n    const length = timeSeries.length;\n    let sum = 0;\n    for(let index = 1; index < length; index++) {\n        if(timeSeries[index] - timeSeries[index-1] > duration) {\n            sum += duration;\n        }\n        else {\n            sum += timeSeries[index] - timeSeries[index-1];\n        }\n    }\n    sum += duration;\n    return sum;    \n};\n```
['JavaScript']