General doubt........please help
hello @hg11110000

u have written code for the same.
this function will fill all rechable positions with 1 (from x,y).
maintain one visited array to avoid visiting same state again (rest is correct).
run the code…
its giving all garbage output’
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 139856813689472 18
94341132529008 139856813440973 196100078 439 264 16216 0 1328
728 1864 312 24 533 24 4096 5669
0 0 0 139856813223380 0 0 7 139856813079312
64 139856813079248 139856813681280 0 288230380446694912 139856813223583 0 64
141733920768 33 0 94341132518261 1 140722327577528 140722327577544 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 139856813689472 18
94341132529008 139856813440973 196100078 439 264 16216 0 1328
728 1864 312 24 533 24 4096 5669
0 0 0 139856813223380 0 0 7 139856813079312
64 139856813079248 139856813681280 0 288230380446694912 139856813223583 0 64
141733920768 33 0 94341132518261 1 140722327577528 140722327577544 0
… . . . … . . . . . . . .
how it able to go ahead in 2nd test case although P is there as a barrier ??
it should visit only the top right triangle only naa ??
@hg11110000
i have answered ur general doubt.
u were asking from x,y u need to mark all rechable state to 1.
simply add b[x][y]==‘P’ in ur if statement of f function.
cant i just check if at the diagonal of king if the bishop visited…then the ans is yes ???
its not passing test cases now also ???
@hg11110000
check now->
u only have to check position of king ,if it is visited then yes otherwise no
