Funky chessboard


here the function will return the max blocks that can be covered by the knight ( from best path)
and then in main function i have subtracted total blocks - blocks that can be travelled.

can you explain me your logic (provide some comments in your code ) it will be easier for me to understand , i can explain you a similar and logic for this problem as your code
what you need to do is once you visit a cell, then visit all the cells that can be visited from this cell and also visit the cells that can be further visited from the next reachable cells.

check code here , i have explained the logic along with the code :-

In case of any doubt feel free to ask :slight_smile:

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.