Explanation of solution of Strip on Codeforces

I was trying to find the solution of problem Strip on codeforces. The editorial written is very brief so could hardly get anything from it. Please someone explain the editorial given here.