[Java] easy linear solution
\nclass Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) {\n        int res = 0;\n        for (int i=0;i<timeSeries.length;i++){\
```\nclass Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) {\n        int res = 0;\n        for (int i=0;i<timeSeries.length;i++){\n            res+=duration;\n            if (i>0)res+=Math.min(timeSeries[i]-(timeSeries[i-1]+duration), 0);\n        }\n        return res;\n    }\n}\n```
[]