A correct solution:

Can someone tell me what is being done in the step Ti=max(T,), t[i]=min(t[i],Ti);
I have read the editorial and tried to implement it but nowhere did i use this step which is there in all other correct solutions. Please explain.

Here is my WA solution: