Java solution (Beats 99.72%)
Code\n\nclass Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) \n    {\n        int result = 0;\n\n        for (int i = 0; i < ti
# Code\n```\nclass Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) \n    {\n        int result = 0;\n\n        for (int i = 0; i < timeSeries.length; i++)\n        {\n            int j = i + 1;\n            int first = i;\n\n            while (j < timeSeries.length && timeSeries[i] + duration >= timeSeries[j])\n            {\n                j++;\n                i++;\n            }\n\n            if (first == i)\n            {\n                result += duration;\n            }\n            else\n            {\n                result += (timeSeries[j - 1] + duration - timeSeries[first]);\n                i = j - 1;\n            }\n        }\n\n        return result;\n    }\n}\n```
['Array', 'Two Pointers', 'Simulation', 'Java']