Easiest cpp code,Easy to understand
\n int findPoisonedDuration(vector<int>& time, int dur) {\n        if(time.size()<1) return 0;\n        int diff=0;\n        int sum=dur;\n        for(int i=1;i
```\n int findPoisonedDuration(vector<int>& time, int dur) {\n        if(time.size()<1) return 0;\n        int diff=0;\n        int sum=dur;\n        for(int i=1;i<time.size();i++)\n        {\n            diff = time[i] - time[i-1];\n            if(diff>=dur)\n            {\n                sum+=dur;    \n            }\n            else\n            {\n                sum+=diff;\n            }\n                \n        }\n        return sum;\n    }\n```
['C', 'C++']