Mike and infinite grid

plz give the pseudo code for pre computing the losing positions in the 1000*1000 grid i am unable to figure out the losing position condition

To calculate for position (i,j), The condition is that if there is a winning position in ith row or jth column or on diagonal, then this position is losing position, now to check these conditions efficiently, you may follow this code:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.