[C++] Simple Solution | beats 98% Runtime | Self-Explanatory
\nclass Solution\n{\npublic:\n    int findPoisonedDuration(vector<int> &timeSeries, int duration)\n    {\n        if (timeSeries.size() == 0)\n            retur
```\nclass Solution\n{\npublic:\n    int findPoisonedDuration(vector<int> &timeSeries, int duration)\n    {\n        if (timeSeries.size() == 0)\n            return 0;\n        int res = duration;\n        for (int i = 1; i < timeSeries.size(); ++i)\n        {\n            if (duration <= timeSeries[i] - timeSeries[i - 1])\n                res += duration;\n            else\n                res += timeSeries[i] - timeSeries[i - 1];\n        }\n        return res;\n    }\n};\n```
[]