O(n) Java Solution
java\npublic class Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) {\n        int res=0;\n        if(timeSeries==null||timeSerie
```java\npublic class Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) {\n        int res=0;\n        if(timeSeries==null||timeSeries.length==0||duration<=0) return res;\n        for(int i=1;i<timeSeries.length;i++){\n            res+=Math.min(duration, timeSeries[i]-timeSeries[i-1]);\n        }\n        return res+duration;\n    }\n}\n```
[]