Very Easy C++ Solution with Explanation
Logic:\n If it is poisoned after the duration period (not intersecting time periods) , add last duration period to answer\n else (intersecting time period) coun
## Logic:\n* If it is poisoned after the duration period (not intersecting time periods) , add last duration period to answer\n* else (intersecting time period) counter again starts \n\t* Add the time Elapsed to answer\n* Update the duration end period at each iteration \n* Add the duration at the end of loop means the last duration period occur without interruption\n\n```\nclass Solution {\npublic:\n    int findPoisonedDuration(vector<int>& timeSeries, int duration) {\n        int ans=0;\n        int end=timeSeries[0]+duration-1;\n        for(int i=1;i<timeSeries.size();i++){\n            if(timeSeries[i]>end){\n                ans+=duration; \n            }else{\n                ans+=(timeSeries[i]-timeSeries[i-1]);\n            }\n             end=timeSeries[i]+duration-1;                \n        }\n        ans+=duration;\n        return ans;\n        \n    }\n};\n```
[]