Funky chess board

I tried to solve this problem but I got tle
My code link : https://ide.codingblocks.com/s/185847

You are not applying backtracking properly …we have to consider each path of it and count of the number of cells visited in that path and minimise that number. Your code simply counts the number of all the possible cells that the knight can reach in total.

That is ,you have find one path where the knight can cover the maximum no of cells and your knight has to stick to it without going back.

After calling the function you are returning the value, which prevents backtracking.

1 Like

Sorry for that here is new link : https://ide.codingblocks.com/s/185858

can you suggest any changes in the code ?


Hey you can refer this code.

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.