Can anyone explain the editorial for H. Bots problem from Codeforces

Problem: Problem - 575H - Codeforces

The solution explanation/discussion is in the comments. I could not understand the editorial. Please help me! Thanks!