XOR Matrix

The problem:

My code:

I used brute force to solve this problem. The function ‘process’ just takes a cell and then finds if the condition is satisfied by adjacent cells. the if statements are for the boundary conditions.

I tried printing the matrix and finding the total walks manually and verified it with the output from my code.
But my submission is not accepted. Can anyone help me in finding whats wrong with my code?

Can you explain what you mean by “submission is not accepted”. Did you get a Wrong Answer, or some other problem ( like SIGSEGV or NZEC )

It shows wrong answer.