Teemo Attacking


  • 0
    M

    class Solution {
    public:
    int findPoisonedDuration(vector<int>& timeSeries, int duration) {
    int ans=0;
    if(duration==0||timeSeries.size()==0) return 0;
    for(int i=1;i<timeSeries.size();i++){
    ans+=(timeSeries[i]-timeSeries[i-1])/duration==0 ? (timeSeries[i]-timeSeries[i-1])%duration:duration;
    }
    return ans+duration;
    }
    };


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.