Teemo Attacking Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int findPoisonedDuration(vector<int>& timeSeries, int duration) {\n        int i, time=0;\n        for(i=0 ; i<timeSeries.size()-1 ; i++)\n        {\n            if(timeSeries[i]+duration-1<timeSeries[i+1])\n            {\n                time += duration;\n            }\n            else\n            {\n                time += timeSeries[i+1]-timeSeries[i];\n            }\n        }\n        time += duration;\n        return time;\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/d8b4e942-4e8c-49dd-a133-bdd3e831d8eb_1682612623.4015508.jpeg)\n
['C++']