How to do this question?

I am not getting any idea

hello @haseebshaik00

What we have to do is find the minimum number of squares that the knight can not reach under the constraint that the knight may not move to any square that is not on the board and cannot rest at any spot more than once .

You can solve this problem using recursion with backtracking . 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. and keep tracking the number of cells you have visited in one traversal until there is no cell that you can visit further,also keep marking the visited cell so that you dont visit those cells again.