Easy to understand Java solution
We just need to take the minimum value between the difference of previous timestamp and the current timestamp, and the duration.\nThis makes sense because the p
We just need to take the minimum value between the difference of previous timestamp and the current timestamp, and the duration.\nThis makes sense because the poisoning will happen at each timestamp.\nAt the end, I am adding the duration to the total answer to take in consideration the poisoning at the last timestamp.\n\n```\npublic class Solution {\n    public int findPosisonedDuration(int[] timeSeries, int duration) {\n        \n        if(timeSeries.length == 0)return 0;\n        if(timeSeries.length == 1)return duration;\n        \n        int total = 0;\n        for(int i=1; i<timeSeries.length;i++)\n        {\n            total += Math.min(duration,timeSeries[i]-timeSeries[i-1]);\n        }\n        \n        total += duration;\n     \n     return total;   \n    }\n}\n```
[]