This should not be ranked Medium
This question should probably be rated Easy, it\'s pretty straightforward compared to most other Medium rated questions.\n\nAnyways, here\'s my O(n) Javascript 
This question should probably be rated Easy, it\'s pretty straightforward compared to most other Medium rated questions.\n\nAnyways, here\'s my O(n) Javascript solution:\n```javascript\n/**\n * @param {number[]} timeSeries\n * @param {number} duration\n * @return {number}\n */\nfunction findPoisonedDuration(timeSeries, duration) {\n    let total = 0\n    for (let i = 0; i < timeSeries.length; i++) {\n        let diff = timeSeries[i+1] - timeSeries[i]\n        if (diff < duration) total += diff\n        else total += duration\n    }\n    return total\n}\n```
[]