Easy Java O(N) TC, O(1) Space Short Code
We take a temp variable called max, which represents the maximum day that we have considered. If the current attack time is < max, then we only need to add the 
We take a temp variable called max, which represents the maximum day that we have considered. If the current attack time is < max, then we only need to add the i+duration - max to the answer as thats the time unaccounted for and we also update max. Else we just simply add duration to answer and update max. \n\n\n```\n\nclass Solution {\n    public int findPoisonedDuration(int[] timeSeries, int duration) {\n        int ans = 0;\n        \n        int max = 0;\n        \n        for(int i : timeSeries){\n            if (i < max){\n                ans += ((i + duration) - max);\n                max = i + duration;\n            }\n            else{\n                ans+= duration;\n                max = i + duration;\n            }\n        }\n        \n        return ans;\n    }\n}\n\n```
[]