Can anyone please explain how modified board is being used…as in the given test case
3
1 1 1
1 1 1
1 1 1
the one remaining place where knight cannot go using the space given ,can visit by going out (by going out i mean staying in 10*10 matrix),so shouldnt the answer be 0.I hope you understand what i am trying to say
Funky Chess board
@harshitgrover12
For this testcase , the size of the board is given as 3 * 3. Hence the knight must always stay in the 3 * 3 board. The knight cannot move out of this. The 10 * 10 board you are considering does not exist in this testcase. That is defined as the maximum size for the worst case , not every case. Here in this 3 * 3 board , there is no way for the knight to reach the center block and hence the answer is 1.
so what is the meaning of modified board …how it is being used…can u please explain using a testcase
@harshitgrover12
Input :
4
1 0 1 0
0 0 1 0
1 1 0 1
0 0 0 0
Expected Output : 2
Here , the blocks having 1 are a part of the board and the blocks having a 0 are not part of the board ,i.e. the knight cannot go these cells. Also the size of the board total is 4 * 4 only , ( which has some cells that are not even part of the board even ) so the knight can never jump out of 4 * 4 overall board either.