• + 0 comments

    Your solution was really smart, but i have to undertand why you added the negative K (a[q+1]-=sum;) at the end of the interval and i have to mitigate the execution time finding the real range from n array and, at the moment of adding, avoid all the cero elements to performe the add (x=x+a[i]) and max comparation.