Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 283 Bytes

495. Teemo Attacking.md

File metadata and controls

12 lines (11 loc) · 283 Bytes
class Solution {
public:
    int findPoisonedDuration(vector<int>& timeSeries, int duration) {
        int ret = duration;
        for (int i = 1; i < timeSeries.size(); ++i)
            ret += min(duration, timeSeries[i] - timeSeries[i-1]);
        return ret;
    }
};