Probliem link:- CodeChef: Practical coding for everyone
Here in the sample test case, the position of king is [1,1] and the rook 1 is at [8,2] and the rook 2 is at [2,3]…
So here the rook 2 will move from [2,3] to [2,1] in 1 move so as to give a check to the king…
The king only has 3 possible moves
- move to [2,1] (but the king cannot move here as rook 2 is already at that place)
- move to [2,2]
- move to [1,2]
For 2. and 3. in both the cases the king can easily be killed by rook 1 who is at [8,2]…
Then why is the answer NO??
According to above explanation, there is a way possible to checkmate the king…
Someone please explain…