Easiest Solution Ever :P
Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) O(N)\n\n- Space complexity:\n Add your space complexity here, e.g. O(n) O(1)\n\n# Code
# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int findPoisonedDuration(vector<int>& timeseries, int duration) {\n        int ans = 0;\n        for(int i = 0; i< timeseries.size()-1; i++)\n        {\n            if(timeseries[i]+duration<timeseries[i+1])\n            {\n                ans+=duration;\n            }\n            else\n            ans+=timeseries[i+1]-timeseries[i];\n        }\n        return ans+duration;\n    }\n};\n```
['C++']