Showing wrong ans for 2 tc

u are not mantaining the count of max moves the knight has made in that particular journey

u need to have another global variable which keeps track of the max steps the knight has taken in that journey

in case u are unable to code what i told
ping me back i`ll help u

moved array maintains all the squares my knight can move. insum contains total number of initial squares. sum contains total squares my knight.

why i need to maintain another array as i can take their sum at the end.

no i am just asking u to maintain a global variable that is it

can u give me example of test case i am failing

8
1 1 1 0 0 0 0 0
1 1 1 0 0 0 0 0
1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0
0 1 1 1 0 0 0 0
0 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 0

required o/p : 4
ur o/p 0