Can anyone solve my simple doubt plzz

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

  1. move to [2,1] (but the king cannot move here as rook 2 is already at that place)
  2. move to [2,2]
  3. 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… :thinking:

Initial
8
7
6
5
4
3    r
2                       r
1  k                           
   1  2  3  4  5  6  7  8 


after rook to [2,1]
8
7
6
5
4
3      
2                       r
1  k  r                         
   1  2  3  4  5  6  7  8

King can take the threatening rook
In the question, there is nothing about king not being able to attack even if it can eliminate the threat.

1 Like