It does not deserve a Medium difficulty, is it?
As title, it's very straightfoward, isn't it?\n\nBTW, my simple JavaScript solution.\n\njavascript\n/**\n * @param {number[]} timeSeries\n * @param {number} dur
As title, it's very straightfoward, isn't it?\n\nBTW, my simple JavaScript solution.\n\n```javascript\n/**\n * @param {number[]} timeSeries\n * @param {number} duration\n * @return {number}\n */\nvar findPoisonedDuration = function(timeSeries, duration) {\n  let ans = 0;\n\n  for (let i = 0, len = timeSeries.length; i < len; i++) {\n    if (i === len - 1) {\n      ans += duration;\n      continue;\n    }\n\n    let curItem = timeSeries[i]\n      , nextItem = timeSeries[i + 1];\n\n    if (curItem + duration <= nextItem)\n      ans += duration;\n    else\n      ans += nextItem - curItem;\n  }\n\n  return ans;\n};\n```
[]