C# soltuion
Idea\n\nWe calculate the poisoned condition time between any two consecutive time, then sum them up to get the result. Now assume t1 and t2 are two consecutive 
### Idea\n\nWe calculate the poisoned condition time between any two consecutive time, then sum them up to get the result. Now assume t1 and t2 are two consecutive time that Teemo attacks, then how long Ashe will be in poisoned condition between t1 and t2?\n\n* Case 1: ```t2-t1 >= duration```, the poisoned condition between t1 and t2 will last for ```duration```.\n![image](https://assets.leetcode.com/users/images/3f250721-fe96-4ae8-b18b-ec8959396dca_1601226575.4473505.png)\n\n\n* Case 2: ```t2-t1 < duration```, the poisoned condition between t1 and t2 will last for ```t2-t1```.\n\t![image](https://assets.leetcode.com/users/images/be838431-0a7b-4bba-947a-2db0cce2c7dc_1601191573.5588152.png)\n\n\n\n### Solution\n```\npublic class Solution {\n    public int FindPoisonedDuration(int[] timeSeries, int duration) {\n        \n        if(timeSeries == null || timeSeries.Length == 0)\n            return 0;\n        \n        int res = 0;\n        \n        for(int i = 0; i < timeSeries.Length - 1; i++)\n        {         \n            int diff = timeSeries[i + 1] - timeSeries[i];\n            \n            if(diff >= duration)\n                res += duration;\n            else\n                res += diff;          \n        }\n        \n        return res + duration;\n    }\n}\n```\n\n### Complexity\n* Time: O(n)\n* Space: O(1)\n\nhttps://www.youtube.com/watch?v=XkWu1nN7o2k&feature=youtu.be
[]