HELP on the problem ALIEN INVASION

Hello,
There’s this problem called alien invasion from CodeChef lunchtime if someone could provide me with the editorial of the question or explain to me the solution it would be great.
The problem code link -> https://www.codechef.com/LTIME87B/problems/ALIENIN