Please check the code

my code passed sample test case , but I am getting WA in all test cases. Please check the code

Hello @aakash47 your code is not even producing the correct result for sample test case:
you have to find the number of unreachable blocks by the knight.

please explain your approach of doing this:
i have doubt in your approach.

Now, it is working for sample test case, I am checking the possible moves and callng the function for that particular move. And calculating the maximum value of moves possible in one go.

and then subtracting the max value from n*n.

@aakash47 yes right your code is producing right answer for the sample test case:
but not for the other test cases:
i think your code is running on the next nodes only for value 1 and that is why it giving you wrong answer wheread i think the value can be evaluated from 0 as well.
think of this code:
https://ide.codingblocks.com/s/421723
Happy Learning!!

I am subtracting max from n*n , but we have to find minimum number of squares of modified chess board. That’s why I am getting WA. Thanks for help bro.

@aakash47 thats why i had told you that i doubt on your approach.

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.

HEllo @aakash47 you have raised the doubt again tell me what is the problem that you are facing?