Funky Chess Board

How should I approach this problem

hello @nitinchoudhary260

write a recursive function solve(i,j) that tells u maximum number of cells u can visit from (i,j).

here at each step u have eight option but u can pick only one (the path that visit maximum number of cells).

since we have 8 ways to proceed from (i,j) , we will try all.
and pick one that visits maximum cells.

solve(i,j) = 1+ max( all eight ways)
check this->

Thanks for the explanation

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.