most easy understanding java solution

  • 0
    public class Solution {
        public int findPoisonedDuration(int[] timeSeries, int duration) {
            int len = timeSeries.length;
                return 0;
            int sum=0;
            for(int i=0;i<len-1;i++){
                int gap = timeSeries[i+1]-timeSeries[i];
                sum += Math.min(gap,duration);
            sum +=duration;
            return sum;

Log in to reply

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