I was doing this problem on the codeForces platform and I was not able to do this. So I read the editorial but it is very confusing, so if anyone helps me with the intuition