Please check code for Funky chess board problem


Not able to pass all test cases.

hello @sahilkhan2312000131

u have misunderstood the problem.

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

u can traverse some path then come back and traverse another path and add answer of both.

its like
1 + max( among 8 path, that visit highest no of cells)

check this->

I am not able to get your solve function. Can you please explain.

solve(i,j) returns maximum cell u can visit from (i,j).

since we have 8 ways to proceed from (i,j) , we are trying all.
and picking one that visits maximum cells.

solve(i,j) = 1+ max( all eight ways)

Why adding this 1 to max??

we are on (i,j) na, so we need to include that cell as well in our answer

ohk…thank you so much

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.