Editorial for CF round 424, question-c

I am unable to understand the editorial of this question from CF round 424. Please, anyone, help me with your detailed explanation.