Robot Collect Points

why my code is giving wrong answer.

@rohit2299
Your logic is incorrect
You’re assuming that 5*5 erase operation can be performed only at the top
That’s not true
You can clear any 5*5 region in the grid
Kindly see the question again once

I did not get it can you explain with an example pls.