Funky chess board problem


My code is not working for all the test cases. May I know the mistake.

@nayakashutosh99 hey refer to this code using dp

What’s the mistake in my code?

@nayakashutosh99 your code is giving segmentation fault for cases like
3
1 0 0
0 0 1
0 0 0

it’s giving 0 as answer which is correct

@nayakashutosh99

okay… Thank you very much!!!