Java | Iterative | Easy Implementation
\nclass Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) {\n        int n=timeSeries.length;\n        if(n==0) \n             ret
```\nclass Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) {\n        int n=timeSeries.length;\n        if(n==0) \n             return 0;\n        int total=0;\n        for(int i=0;i<n-1;i++)\n            total = total + Math.min(timeSeries[i+1]-timeSeries[i],duration);\n        return total+duration;\n    }\n}\n```\nKindly upvote if you like the code.
['Iterator', 'Java']